In Thesis Theme Put AdSense Ads Above WordPress Posts


Yesterday I wrote a post on putting adsense ads below posts in thesis theme. The way is much similar to what I have decribed previously. The only difference is that the thesis hook functions will change

Way To Put Adsense Code Above Posts:

enter wordpress panel –> under thesis select custom file editor –> edit the custom functions php file

thesis 1.7 custom file editor

At the end of the file put:

function adsenseaboveposts() {
if (is_single()) {
?>
put adsense code here
<?php
}
}
add_action('thesis_hook_before_post', 'adsensebaboveposts');

As explained before, if (is_single()) { means the ad you placed before the posts will only show inside the posts not on the homepage.

The adsense ads will appear like below:

If you want the ad to appear on both homepage and inside posts you can use the code below:

function adsensebaboveposts() {
?>
put adsense code here
<?php
}
add_action('thesis_hook_before_post', 'adsensebaboveposts');
About Nasif

I am a hobby blogger and I love Wordpress. Herbal tea addict. Loves being lazy and zZzZ...