This tutorial is on How To Place Ads On Homepage Only in the Thesis Framework. Some bloggers want to customize their themes in a way to show ads on homepage sidebar only, and then use different ad units on single posts, just the way I’m currently doing so. Even though I’m a coding geek (trying to become more better), this is going to be a first code-post from me.
Hence, following is the code which will help you to place ads on hompage sidebar only. Note that the code is specifically functioned ONLY FOR Thesis Theme Framework, and hence would not work with any other theme.
Adding this code will not show up on single posts/pages.
Place Ads On Homepage Only In Thesis Theme
The following is the function code, which needs to be added in the custom_functions.php file.
function homepage_before_sidebar_ad() { if (is_home()) { ?>
<div class="hompage_ad">
//Your Code Here. Remove The slashes as well//
</div>
<?php
}}
add_action('thesis_hook_before_sidebars', 'homepage_before_sidebar_ad');
Needless to say, replace “/* Your Ad Code Here */” with your own code. You’re free to use any ad code you want – Google Adsense, Affiliate Banner etc.
Style (CSS) To Place Ads On Homepage
Add the following CSS codes to the custom.css.
div.homepage_ad {
margin-left: 11px;
margin-top: 5px;
}
The values can be arranged according to the size of your theme.
Why Place Ads On Homepage Only?
This question might arise from some of you. The answer to this is that some bloggers might want to place a sidebar banner but want it to be displayed only on the homepage. There might be a couple of reasons for this.
- The single posts might be showing ads between the content, hence want to keep the sidebar clean.
- The blog owner might not want to distract the readers of a single post.
Hence, to show ads on homepage sidebar only, add the above codes into the custom files respectively.
If you have any questions or need any help regarding the same, do not hesitate to use the comments section below.
Hope this tutorial of placing ads on homepage sidebar was helpful.



Twitter: khajamoin1
September 21, 2012
This is very good option. Making money without disturbing readers.
I see even Lifehacker does same.
~@khajamoin1
Khaja moin recently posted..Top 15 Video Sharing Sites to Increase Blog Traffic
Twitter: raajtram
October 6, 2012
Exactly Khaja. Thanks for passing by. Cheers
Raaj Trambadia recently posted..3 Ways To Increase Social Media Sharing
Hi Raaj,
Placing ads on homepage only does make sense, especially if you do not like disturbing or distracting readers when reading on your blog posts, and it keeps your blog neat and professional looking. Thanks for sharing!
Felicia recently posted..WSOP Europe: 7-Hour Heads-Up Between Brandon Cantu & Jonathan Aguiar
Twitter: raajtram
October 6, 2012
That was my point Felicia! Thanks for passing by! Cheers
Raaj Trambadia recently posted..3 Best Ways To Make Money Blogging (For Beginners)
Twitter: geek_noob
October 2, 2012
I am never going to use adsense I believe as my adsense application for my website gets rejected every now and then. I have in built option in my theme to place adds anywhere I wish.
Kundan Bhardwaj recently posted..Different Search Engines like Google for Special Search
Twitter: raajtram
October 6, 2012
Don’t lose hope Kundan. Even I had the same problem in the beginning, but you got to focus on your blog FIRST and then, adsense will follow!
All the best with the same!
Raaj Trambadia recently posted..3 Ways To Increase Social Media Sharing
Thanks Raaj Trambadia i am really looking for this awesome.
hazalzlen recently posted..Exposed Skin Care Reviews Does Exposed WORK
Twitter: jonnalarajkumar
October 30, 2012
Hi raaj,
Thesis is one of my favorite platform among all the wordpress platform, and yeah iam using some adsense ready skin which can easily and default has the ad placement slots..
thanks
hie admin, thanks to sharing this useful informations for only homepage ads… i also want to put ads only home page page only… this custom file are really useful for me because i am not able to make these type file or code…. thanks again