Thesis is a great framework which is been recommended by many of the top bloggers and SEO guru’s. Thesis uses hook’s to define and create its theme therefore its bullet proof. you can get list of Thesis Hooks here , Now using those hooks only we are going to add Adsense/Ads in thesis theme.
How add Adsense/Ad below post title in thesis
We are going to use thesis_hook_before_post this Hook adds the content before the post content.
Lets get started :
- Login to your WordPress Dashboard
- Navigate through Thesis >> Custom File Editor
- Select custom_functions.php
- In custom_functions.php add the below code :
function before_post_ads() { if (is_single()) { ?> Your Ad Code Here ! <?php } } add_action('thesis_hook_before_post', 'before_post_ads');
- In the above code replace on 3rd line replace “Your Ad Code Here !” with your Google Adsense Code
- Now Just save it
This will Place the Ad after the post title.
How to Place the Ad after the post content
to Place the Ad after the post content use the below code :
function after_post_ads() { if (is_single()) { ?> Your Ad Code Here ! <?php } } add_action('thesis_hook_after_post', 'after_post_ads'); |
Hope you like it, will be waiting for your feedback.