How To Insert Ads on Thesis Theme?

by Tinh Tran on August 15, 2010 · 29 comments



Many of my friends found thesis theme the most challenging framework for wordpress. It is both ugly in terms of design and difficult to work with. It took them a lot of time to change a small thing like background colour, title font….I have also had the same feeling. However, Thesis theme is now my favorite framework and I have no plan to switch to other themes.

I have ever thought to quit using thesis theme after a while but I did not. The reason was simple as this framework has benefited me a lot in terms of both knowledge and money too.

It urges me to learn thesis theme hooks & filters and I am confident that I can play around with hooks now but not yet mastering all of them. Anyway, I feel very happy as I can do it myself rather than searching on the internet. However, CSS and special customization like what you see on this blog is out of my capability icon smile How To Insert Ads on Thesis Theme?

Here are some tweaks that help you place any kind of ads on several positions of your thesis powered blogs. All things will go through custom_functions.php file and you do not need to edit your PHP file anymore. This is also a great feature that normal themes can not do.

1. Ad After & Before First Post Only on Home Page

This code will guide you how to place your ads on the homepage right under the first post. The ad will not show on the second post downwards as well as single posts.

Place this tag on your custom_functions.php file either through FTP or File Custom Editor tab n your WordPress admin:

Before the first article only:

function before_first_post_ad($post_count) {
  if (is_home()) {
    if ($post_count == 1) { ?>
       // INSERT YOUR AD CODE HERE
    <?php }
  }
}

add_action('thesis_hook_before_post', 'before_first_post_ad');

After the first article only:

function after_first_post_ad($post_count) {
  if (is_home()) {
    if ($post_count == 1) { ?>
       // INSERT YOUR AD CODE HERE
    <?php }
  }
}

add_action('thesis_hook_after_post', 'after_first_post_ad');

2. Ad After & Before Single Post Only:

This code wil help you show your advertisement only on single posts. You will never see your ads on homepage or pages. Place the tag below to your custom_functions.php file:

Before the single post only:

function before_single_post_ads() {
if (is_single()) { ?>
// INSERT YOUR AD CODE HERE
<?php }
}

add_action('thesis_hook_before_post', 'before_single_post_ads');

After the the single post only:

function after_single_post_ads() {
if (is_single()) { ?>
// INSERT YOUR AD CODE HERE
<?php }
}

add_action('thesis_hook_after_post', 'after_single_post_ads');

3. Ad After & Before Content

This function will enable your ads right after the content box of your thesis. You can position it either before or after contents:

Before the content only:

function before_content_ad() { ?>
// INSERT YOUR AD CODE HERE
<?php }

add_action('thesis_hook_before_content', 'before_content_ad', 1);

After the content only:

function after_content_ad() { ?>
// INSERT YOUR AD CODE HERE
<?php }

add_action('thesis_hook_after_content', 'after_content_ad', 1);

4. Ad on Pages Only:

If you want to have a specific ads on pages only, this tag will help you do that. Just place the code below in your custom_functions.php:

Before the pages only:

function before_page_ads() {
if (is_page()) { ?>
// INSERT YOUR AD CODE HERE
<?php }
}

add_action('thesis_hook_before_post', 'before_page_ads');

After the pages only:

function after_page_ads() {
if (is_page()) { ?>
// INSERT YOUR AD CODE HERE
<?php }
}

add_action('thesis_hook_after_post', 'after_page_ads');

5. Ad within single post:

Most of bloggers who are using Thesis theme love this tricks as it seems to increase their adsense CTR effectively. The code will show your ads next to your content and draw more attention from your readers that can lead to natural clicks too.

Just place the tag below in your custom_functions.php file and see how it can help you make more money:

function ad_within_single_post ()  {
if (is_single()) { ?>
<div style="float:right; padding-left:3px;">// INSERT YOUR AD CODE HERE</div>
<?php
   }
}
add_action('thesis_hook_before_post','ad_within_single_post');

You can navigate your ads from right to left margin by changing “Right” to “Left” in the code. It is really easy right?

I hope these tutorials will help you insert your ads on the most popular postions on your thesis theme blogs without using any plugins.

    My Recommended Tools for Internet Marketers

  • Hosting Review Script This tool helps you build a profitable yet professional hosting review model on autopilot and resolves the most common issue from other tools of same type that is real ratings of hosting providers based on different criteria!
  • Niche Video Site Builder #1 In JVZoo for a reason... This is the most popular video website builders. Improved years after years, it now powers more than 350,000 video websites on the Internet with its unsurpassed features.
  • The Last SEO Secret The Last SEO Secret gives you the opportunity to watch over the shoulder as an SEO Ninja fights back against the penguin update to take over as many spots as possible for a term with over 1,000 searches per day.
  • WebHostingGeeks Clone Script WebHostingGeeks.com is among the top hosting review websites and many affiliate marketers would love to have such a profitable business model. We listened to your call and made this powerful script for your use.

About Tinh Tran
I am a disabled blogger from Vietnam who can make over $3,500/month from affiliate marketing. Affiliate Marketing Guides will guide you how to monetize your blog with affiliate marketing. You can subscribe to my RSS to get instant updates via email.

Follow me on Twitter · Visit my website →

Recommended Premier Thesis Skin for Internet Marketers

Top premier kolakube thesis skins

{ 29 comments… read them below or add one }

Harsh Agrawal August 15, 2010 at 7:56 pm

Tinh that’s a useful post and this post was shared on Twitter and delicious now :)

Reply

Tran Tinh August 15, 2010 at 8:07 pm

Hi @Harsh, thanks for your comment and vote. I hope these tutorials will help some guys who are fans of Thesis theme :-)

Reply

Dev @ Best WordPress Themes August 15, 2010 at 8:33 pm

Tinh,

Great Post. Very Useful code for thesis Users.
Thanks for sharing.

Keep up the good work.

Reply

Tran Tinh August 15, 2010 at 8:50 pm

Thanks for your comment. I hope it helps some thesis fans :-)

Reply

AZ Marketing August 16, 2010 at 5:50 am

Good tutorial to help us improve more knowledge about Thesis, Tinh.

Reply

Tran Tinh August 16, 2010 at 12:47 pm

Thanks, hope you like it too :-)

Reply

George Serradinho August 16, 2010 at 1:15 pm

It’s nice to see others promoting Thesis theme and the ease of adding adverts. You also mentioned many areas where one could post adverts and I’m sure many users appreciate it.

Reply

Tran Tinh August 16, 2010 at 5:43 pm

I have thought about these positions that many bloggers are using now and I hope it can help some thesis fans too. Thanks George :-)

Reply

Ben Lang August 16, 2010 at 2:28 pm

Thanks for the awesome tutorial, appreciate it.

Reply

Tran Tinh August 16, 2010 at 5:46 pm

Thanks @Ben Lang for your first comment. I hope it help you sometimes :-)

Reply

Kharim @ WebMaster-Success.com August 16, 2010 at 11:35 pm

Thanks for this post, even though I know how to add these stuff to thesis already. But it will be helpful for the new thesis users. I will retweet this post :)

Reply

Tran Tinh August 17, 2010 at 11:45 am

Thanks @Kharim for your retweets. I do appreciate that and hope it help other newbies who have just got used to Thesis :-)

Reply

Hidup Seorang Blogger August 17, 2010 at 9:19 am

Hi.. nice entry.. I’m looking for this tutorial to add my Fb and Twitter button..

Reply

Tran Tinh August 17, 2010 at 11:45 am

Thanks @Hidup. You can use this for adding social bookmarking buttons too :-)

Reply

Hidup Seorang Blogger August 17, 2010 at 1:09 pm

Yes.. i know.. anyway, your blog very nice design.. i like.. :)

Reply

Tran Tinh August 17, 2010 at 2:13 pm

Thanks as you liked it. Your blog is good but it is in other language, not English so I can not understand :-)

Reply

Hidup Seorang Blogger August 18, 2010 at 12:03 am

Hi.. your welcome..
yes, this blog is for my language..
maybe you can use google translation if you want reading it..
Thanks..

Anup @ Hack Tutors August 17, 2010 at 10:14 pm

This is really helpful for the thesis theme users. Recently I converted thesis worpress theme into blogger template. Thats was not easy :D

Reply

Tran Tinh August 18, 2010 at 10:02 am

There are several bloggers who have successfully converted Thesis theme into blogger template but the most important thing that many bloggers are concerned is its SEO capability. Your converted version at least looks awesome in terms of interface. Congrats friend!

Reply

Hung | JVPRIME August 18, 2010 at 2:41 pm

Just visit your blog.Very nice

Reply

wazy June 20, 2011 at 9:47 am

Hi
Thanks for this tutorial
Thats why i like to use thesis in my blog

Reply

Ile Maurice August 3, 2011 at 5:53 am

Your blog is simply amazing. Ive been looking for how to insert ads in above the post area in thesis everywhere!!!thanks..
I also wanted to know if there is a way to put an ad somewhere in the MIDDLE of my post area, since my blog consists of a lot of pictures and I can only align my pictures centrally to make it most attractive. So, i was thinking of maybe having one or two pictures, then an ad under it, if you see what I mean.
thanks for your help:)
Ile Maurice recently posted..Q&R: Maurice : flic en flac ou trou aux biches?My Profile

Reply

Tinh Tran August 3, 2011 at 8:19 am

Your case seems complicated that I can not help for now. I will try to find this tip and let you know later
Tinh Tran recently posted..Blogging Tips: To Moderate Comments or Not To Moderate CommentsMy Profile

Reply

Ile Maurice August 3, 2011 at 11:23 am

thanks again. Will keep coming back

Reply

anuj@SEOTIPS October 11, 2011 at 2:41 pm

Thanks so much for this. I’m not even using ads, just custom HTML & PHP. But this is the only place I’ve found that articulates how to use the $post_count attribute to target specific posts’ hooks. A total lifesaver (or at least hairsaver, as I was pulling it out when the documentation said the attribute could be used but didn’t say *how*). Bookmarked!

Reply

thesis help December 26, 2011 at 8:28 pm

It’s really great stuff, I haven’t tried this but it seems easy to implement. I want to put ads on my thesis and blogs, hope this will help me. Thanks.

Reply

caenz March 13, 2012 at 6:46 pm

thanks dude, very nice tutor
anyway i have a question, how to put ads in centre of content??
caenz recently posted..Senarai Peserta & Biodata Protege Mentor 6My Profile

Reply

Tran Tinh August 18, 2010 at 10:03 am

What is that language? I think I need to wait for your English blog as I am a bit lazy reading translation and that tool sometimes can not translate properly :-)

Reply

Hidup Seorang Blogger August 21, 2010 at 2:06 am

This is malay language.. Oh.. its ok.. but i agree with you that translation tool sometimes can not translate properly..

Reply

Leave a Comment

CommentLuv badge

Previous post:

Next post: