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.
janet walker says
Thank you for sharing this code for adding adsense. I have found others sharing a code and yours was the simplest and shortest to use an worked straight away.
Ritesh Sanap says
Janet ,
I m glad that you find out helpful
Kunal says
No really it’s was a fantabulous post….
I applied it… :) thankxx for sharing your knowledge..
Carlos says
Thanks! I can now delete another plugin.
Tom says
I haven’t tried it but it looks like it’s just what I wanted.
Thanks!
jon says
HI
I entered the last bit of code for after the post ad placement but now my site is showing blank white pages, even when i attempt to use my WP admin it just appears blank.
I clicked back in my browser and deleted the code but this isnt doing anything.
Any help would be great!
jon says
I have just uploaded a fresh copy of custom_functions.php.
Is there a reason why it would have made the site go blank? I put the code at the end of the custom_functions.php file, is this wrong?
thanks
Ritesh Sanap says
Hello Jon,
I guess you might have done some sort of mistake, or their might be some other things that are conflicting.
Rob says
Currently, I’m using a plugin to display a 335×280 Google ad on the homepage right below the post title (view http://www.LiveLifeHappy.com). Is there anyway to display this ad using the thesis hook plugin? The issue I had was 4 of the same ads displaying right under each teaser posts. I just want one to display.
Ritesh Sanap says
Yes, you can display ads using Thesis Hook Plugins also
Mani says
Now i have successfully added Chitika ads after I followed your tutorial.
Rohit Agarwal says
Thank you to write this post… It will help me to adsense to thesis.
Technology says
You just made my day bro, i was really tensed and tried 6 to 7 plugins. finally done it. thank love u :)))))
aries says
Excellent…., thank for your share
vinodh says
I want to know the places (hook names) that I need to insert adsense in thesis so that my revenue is maximized .
regards
vinodh
Ritesh Sanap says
Well it is believed that Ads placed near Posts are always highly targeted, so the above codes tell you regarding 2 hooks before post and after post, well other then that if you want to add, then do a research regarding were your visitors click mostly and add a Ad at that spot, this will maximize your Income