How To Place Ads On Homepage Only (in Thesis)

Ads On HomepageOnlyads on the homepage

sidebaronlyONLY FOR Thesis Theme Framework

not

Read Also: DOES COLOGNE EXPIRE OR GO BAD?

Place Ads On Homepage Only In Thesis Theme


custom_functions.php

1

2

3

4

5

6

7

8

function homepage_before_sidebar_ad() {

if (is_home()) { ?>

<div class="homepage_ad">

/* Your Ad Code Here */

</div>

<?php }

}

add_action('thesis_hook_before_sidebars', 'homepage_before_sidebar_ad');

/* Your Ad Code Here */

Style (CSS) To Place Ads On Homepage


custom.css

1

2

3

4

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 with a single post.

Hence, to show ads on the homepage sidebar only, add the above codes into the custom files respectively.

Visit This:3121perfume.com

4.7 Star App Store Review!
Cpl.dev***uke
The Communities are great you rarely see anyone get in to an argument :)
king***ing
Love Love LOVE
Download

Select Collections