The Complete Guide to Including Ads in Your Thesis WordPress Theme

by Phil Barron · 100 comments

If you run a website, you likely want to include ads of some kind in your template.

The problem is, where do you place your ads and how do you get them there?

In this article, I’ll show you the most popular places to include ads…

…and then give you the code to include those ads in your Thesis WordPress Theme!

How to Include Six 125×125 Ads in the Multimedia Box

Ever stumble upon a group of six 125×125 ads? It’s often arranged in a grid pattern and is popular among advertisers. If you want to include this in your Thesis WordPress Theme, it’s easy with the Multimedia Box. In the steps below, I’ll show you how it’s done.

Step 1: Upload Ad Tile Images

Assuming you set your uploaded images to be organized by year and month (this is the default), go to your WordPress administration panel, and then click on Media → Add New in the navigation menu on the left-hand side (click here for an image). This is where you can upload your ad images. Once completing that, continue to Step 2.

Step 2: Include Custom Code in Multimedia Box

Go to Design Options → Multimedia Box. When there, you’ll need to expand Default Settings to reveal the dropdown list, and then select Custom Code (click here for an image).

The Custom Multimedia Box Code field will display, and you should place the following code in this field. However, before saving, you need to replace our default ad images with the URL of the ad images on your server.

<div class="adblock">
    <a href="http://www.adlink1.com/"><img src="../wp-content/uploads/2010/07/ad_125_1.png" width="125" height="125" alt="ad image 1" /></a>
    <a href="http://www.adlink2.com/"><img src="../wp-content/uploads/2010/07/ad_125_2.png" width="125" height="125" alt="ad image 2" /></a>
    <a href="http://www.adlink3.com/"><img src="../wp-content/uploads/2010/07/ad_125_3.png" width="125" height="125" alt="ad image 3" /></a>
</div>
<div class="adblock">
    <a href="http://www.adlink4.com/"><img src="../wp-content/uploads/2010/07/ad_125_4.png" width="125" height="125" alt="ad image 4" /></a>
    <a href="http://www.adlink5.com/"><img src="../wp-content/uploads/2010/07/ad_125_5.png" width="125" height="125" alt="ad image 5" /></a>
    <a href="http://www.adlink6.com/"><img src="../wp-content/uploads/2010/07/ad_125_6.png" width="125" height="125" alt="ad image 6" /></a>
</div>

Step 3: Apply Necessary Styling to custom.css

Like before, you’ll need to paste some code. This time, you’ll need to load up your Thesis File Editor (click here for an image) and paste the following code in your custom.css file:

.custom .adblock {
    text-align: center;
}
.custom .adblock img {
    padding: 4px;
    background-color: #FFFFFF;
    display: inline;
}

What would this look like on a Thesis Theme website? Check out Figure 1 below:

125 ad blocks in default MM box

Figure 1: Six 125×125 ads—you can add these into your Thesis website with the above code.

What if you wanted your ad box to look different?

Well, that’s possible too!

For example, if you wish to remove the background color from the Multimedia Box and spread out the ads to take advantage of white space, you could apply the following code to your custom.css:

.custom #multimedia_box {
    padding: 0;
}
.custom .custom_box {
    background: none;
}
.custom .adblock {
    text-align: center;
}
.custom .adblock img {
    display: inline;
    padding: 15px;
}

And what would that look like? See Figure 2 below:

Same ads expanded and without MM box background color

Figure 2: See how there’s more white space in this ad box? This is great for minimalist Thesis mods.

The above is based on code from Satish Talim (@indianguru).

How to Include Banner Ads in Your Content Column

Most banner advertisements are wide, but relatively short, unless dealing with skyscraper-style ads. For example, this is a half-leaderboard:

half-leaderboard ad

Figure 3. A half-leaderboard ad in standard 468×60 format.

In this portion of the tutorial, I’ll show you how to place this type of advertisement in your main content column, which is a traditional location to include advertising because of its high visibility.

How to Include a Banner Ad in the Content Column

If you use the following code, your Thesis banner ad will be placed at the bottom of your content column (right below the previous/next links if you have those enabled). All you have to do is paste it in your custom_functions.php file.

function after_content_ad() {
?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
}
add_action('thesis_hook_after_content', 'after_content_ad');

Did you notice that I wrapped the ad code inside of a div and have given that div a class named advert? I did this so that, if the need arises, you can add styling to your ad box (for example, a border, maybe?) by adding CSS in your custom.css file.

How to Include an Ad After a Post

Personally, this is one of my favorite ad positions because of its tendency to convert much better than other spots. To include an ad right after a post, paste the following code in your custom_functions.php file:

function after_post_ad() {
?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
}
add_action('thesis_hook_after_post_box', 'after_content_ad');

Let’s say you want to display an ad only after the first featured post on the homepage. To do that, you’ll need to use the $post_count property, but don’t worry, it’s easy. Paste the following into your custom_functions.php file:

function after_first_post_ad($post_count) {
    if (is_home()) {
        if ($post_count == 1) { ?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
        }
    }
}
add_action('thesis_hook_after_post', 'after_first_post_ad');

How to Include an Ad On Single Post Pages

If you thought I loved ads below featured posts, I’m in complete admiration of ads after the single post. For starters, most blogs have much of their traffic hit single post pages. This happens because of direct links and search engines.

Think about it for a second: When you include an ad at the end of a post, one of the highest converting spots on a page, combined with the highest-traffic pages—your single post pages—you can make decent money.

Sound good? Here’s how you do it. Just paste the following code in your custom_functions.php file:

function single_post_ad() {
    if (is_single()) { ?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
    }
}
add_action('thesis_hook_after_post_box', 'single_post_ad');

Now, what if you wanted your ad to display on one single post but not another? How would you do that?

In WordPress, there’s something called a post slug. WordPress will generate a post slug for you by default, and if you’re using pretty permalinks, you’ll have the ability to change this post slug to something concise and memorable, as shown in Figure 4:

WordPress post slug

Figure 4. A custom post slug (code-sample) in the WordPress post editing interface.

You can use this post slug to target specific articles and, by extension, to serve ads on any post or page you like. For instance, if you wanted to target an article with the post slug slug-example, you’d paste this code in your custom_functions.php file:

function single_post_ad() {
    if (is_single('slug-example')) { ?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
    }
}
add_action('thesis_hook_after_post_box', 'single_post_ad');

How to Include an Ad On a WordPress Page

Similar to ads on single post pages, it’s also possible to place a particular ad on all static pages. To do that, paste the following code in your custom_functions.php file:

function page_ad() {
    if (is_page()) { ?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
    }
}
add_action('thesis_hook_after_post_box', 'page_ad');

As in the single posts example above, you may place a certain ad on a particular page. You may also use an array with your conditional to place an ad on several selected pages; for example, let’s say that you’d like to target the pages with slugs foo and bar:

function page_ad() {
    if (is_page(array('foo', 'bar')) { ?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
    }
}
add_action('thesis_hook_after_post_box', 'page_ad');

How to Include an Ad in Your Thesis Header

Many people place horizontal ads in their header because it’s above the fold and affords maximum visibility. To do this, paste the following code in your custom_functions.php file:

function header_ad() {
?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/thesis-468x60.png" width="468" height="60" /></a></div>
<?php
}
add_action('thesis_hook_header', 'header_ad');

In most cases, further adjustments are necessary to position the ad in your desired location. For example, you may wish to set the ad opposite of your site’s text logo and tagline, or perhaps, above the logo.

Fortunately, since we wrapped your ad code within a div with a named class, you can edit these styles very easily. To play around with positioning, paste this code in your custom.css file:

.custom .advert {
    margin: -70px 0 70px 400px;
}

The question is, how do you make this code move your ad? Well, a large left margin will push the ad to the side of the header opposite the logo and tagline, whereas a negative top margin will pull the ad image up to whatever height you desire. Either way, you can play with it—it’s easy to learn once you start tweaking!

How to Include Ads in Your WordPress Sidebar

example sidebar adPlacing ads in your blog’s sidebar is simple. When you load up your Widgets panel, you may drag a text widget to the sidebar of your choice, paste the ad code into your widget, and click Save.

However, what if you want your widget to appear under specific conditions? Doing that from the widget interface can be daunting.

Sure, there are plugins like Widget Logic by Alan Trewartha that work for this task, but with Thesis, you can avoid using the plugin altogether!

Just as we demonstrated earlier with code for placing ads in the content column, you can use functions and hooks to position ads on specific pages or posts. However, the main difference is the hook you use for ad placement.

For example, in the following code, the hook thesis_hook_before_sidebar_1 places the ad before other content in Sidebar 1:

function sidebar_one_ad() {
?>
<div class="advert"><a href="http://www.diythemes.com/"><img src="http://diythemes.com/thesis/wp-content/uploads/2010/08/sidebar-ad.png" width="175" height="245" /></a></div>
<?php
}
add_action('thesis_hook_before_sidebar_1', 'sidebar_one_ad');

Then, as you might have guessed, the hook thesis_hook_after_sidebar_1 will position the ad after other content in the sidebar. Additionally, all of these hooks work for your second sidebar too. The only difference is, instead of using thesis_hook_after_sidebar_1, you would use thesis_hook_after_sidebar_2.

Have any questions? Here’s your chance:

As a test, we’ll leave comments open on this article for a limited amount of time. If you have any questions, please feel free to leave a comment and we’ll do our best to answer your question!

However, before asking your question, here’s some additional reading you should check out. It will help make this a heck of a lot easier!

If you enjoyed this article, enter your email below to get free updates!

{ 100 comments }

Marsha Stopa

Thanks for this! Perfect timing.

One quick question: I am using the standard two-column setup with the sidebar 295 px wide. I realize I can make my ads any size I like, but would be the best-looking size for a sidebar? 250 x250? Or wider?

Many thanks!
Marsha

Phil Barron

This is an interesting question, Marsha, because it brings up padding, a concept that can escape people when they’re considering layout. A 250px square ad in a 295px sidebar might seem a good fit, but that sidebar actually has eleven more pixels (or 1.1em) of space on either side – that’s padding. As a result, that 250px ad will appear to have a lot of space around it. A case could be made for going larger, but I’d suggest testing multiple ad sizes to see which looks best to you in relation to the other elements on the page.

Marsha Stopa

Thanks, Phil.

I was wondering how much padding was built into the sidebar. This is very helpful.

Marsha
P.S. I love your cat pic in the avatar! :-)

Phil Barron

Heh, that’s Kitty #1, baxter. Glad the info was helpful!

Martin Malden

Hi,

This is a superb resource – many thanks!

I’d like to be able to target ads by post tags so that, for example, I can place ads for Thesis only on articles that are tagged as Thesis.

What would the ‘if’ statement be to achieve that? And how would I define 2 tags – for example so that I could place Thesis ads on articles tagged as Thesis and articles tagged as WordPress?

Again – many thanks for this!

Cheers,

Martin.

Phil Barron

Martin, assuming that you want the ad to appear on single post views and that the posts have the tag ‘Thesis,’ you’d want to employ both is_single() and has_tag() along these lines:

if (is_single() && has_tag('Thesis')) {

If targeting two or more tags, you’d use an array like this:

if (is_single() && has_tag(array('Thesis','WordPress'))) {

Martin Malden

Many thanks Phil – very much appreciated..!

Cheers,

Martin.

Martin Malden

PS – just set it up on my site and it works like a charm – thanks again!

Cheers,

Martin.

Phil Barron

Glad to hear it, Martin!

Paul

Thanks for these great tips all wrapped into the one place. A really useful resource.
I’m wondering if you can extend it further by offering suggestions how to place specific ads on archive pages.
For example – display car ads on a car category page.

Phil Barron

Your situation is pretty straightforward, Paul, because we have just one parameter to consider: an archive page. This calls for the conditional is_category(). (If you were placing your ad on posts in a given category, you would change that ‘is’ in the conditional to ‘in.’)

If the archive category is ‘Hybrids,’ then:

if (is_category('Hybrids')) {

You could place ads on multiple category archive pages via an array in the same fashion as in Martin’s hypothetical above.

Frederik

Can you give a complete code example?

I would have used this hook, but I see it has been deprecated: Ihttp://diythemes.com/thesis/rtfm/hooks/thesis_hook_archive_info/

Jorge Ledesma

Excellent tutorial, well done Chris

Derek

It was Phil Barron who wrote it. He works for DIYthemes.

Milan

Here’s a feature I think would be awesome to see in a future Thesis release: a system for not displaying ads for logged-in users who have signed up for a subscription.

If you made it really straightforward to set up, using something like Google Checkout or PayPal for payments, you could create a whole new revenue model for Thesis users.

I really like how Thesis lets me run a professional looking site without learning a bunch of CSS and HTML. Creating content is my purpose. If Thesis could also provide similar support for a subscription based revenue model it would be an even more essential add-on to WordPress.

Milan

As an addition to the above, you could also create a system for making ‘exclusive content’ posts that only appear to subscribers.

Phil Barron

Those are interesting ideas, Milan. Your second post’s idea can possibly be accomplished in the near term with a membership plugin like Role Scoper.

Hashim Warren

Excellent resource.

Any ideas on how to rotate ads?

Phil Barron

Hashim, it happens that DIYthemes forum member seekingff has a tutorial on this very topic posted on the boards! It’s well worth a look.

Tech Maish

I implement the code for showing ads On Single Post Pages, but it is showing on the home page.
I don’t know what i did wrong. Previously i added the code using Thesis Hook, but it is showing on home page.

Phil Barron

Would have to see the code to figure out what the problem is; also, the example code is meant to be placed in custom_functions.php (as opposed to placing it via the plugin Thesis OpenHook). If you post your code at the official DIYthemes support forums, we can troubleshoot it for you.

Randall Soules

Thank you for a very informative and useful article. This is something that all of us need to understand. Keep up your excellent work.

Phil Barron

Happy to provide it, Randall. :-)

Ryan Beale

Phil,

Thank you very much for this post! I’m always looking for more ways to spice up my Thesis sites and eventually will be including ads on some. I’ll be using this guide to customize my sites w/ ads. Thanks again.

@RBeale

Phil Barron

No problem, Ryan!

Thomas Griffin

And for those that don’t want to use the MM box for the 125×125 ads, you can achieve the same results using an unordered list and styling it appropriately in your custom.css file.

Excellent guide, Phil!

Phil Barron

Thanks for that, Thomas! Yes, people needn’t feel compelled to use 125px square ads only in the MM box.

Lyman Reed

Just wanted to say thanks! I’ve been wanting to work something like this out for a while now, and this post finally made it possible. I also appreciate the answers to the questions in the comments… damn fine job. :)

Phil Barron

Thank you very much, Lyman!

Martin Malden

Phil, hi,

Martin here again…

I’m now trying to extend the targetting of ads to posts with specific tags by placing a different banner on posts in a different category. So far I have this code which is working perfectly:

function single_post_ad() {
    if (is_single() && has_tag(array('thesis theme','themes'))) { ?>

<?php
    }
}
add_action('thesis_hook_after_post_box', 'single_post_ad');

I then created a new function:

function single_post_adtt() { 
     if (is_single() && in_category('internet marketing')) { ?>

<?php
    }
}
add_action('thesis_hook_after_post', 'single_post_adtt');

Basically the only difference (apart from the links) is the different function name. This doesn’t return any errors but it also doesn’t display the ad. Could you tell me what I’m doing wrong?

Many thanks as always! Cheers!

Martin Malden

Sorry – I copied from an old version of the code: the hook I’m adding to in both cases is thesis_hook_after_post, not post_box as I’ve pasted in the first snippet above.

My apologies – the code on the site is identical except for the URLs of the banners and the links.

Phil Barron

That basic approach should work. I tested this on a site -

function sponsored() {
  if (is_single() && in_category('Graphic Design')) {
?>
//AD_LINK
    <?php }
  }
add_action('thesis_hook_after_post', 'sponsored');

- which works fine. However, entering the name of the category in lowercase (which is not how I actually spelled the name of the category) caused the conditional to fail. Is your category ‘Internet Marketing’ actually capitalized? If so, adjust for that in your function to see if it works.

Martin Malden

Absolutely spot on – works like a charm..!

Many thanks – I really appreciate both the original article and your quick responses!

Thanks again,

Martin.

Phil Barron

My pleasure, sir. :-)

Alissa

Thank you so much for this clear tutorial and this helpful reply! I did it and it worked! (definitely deserves exclamation points coming from me ;) ) I am using tags and now have a different kind of ad showing up on certain posts with certain tags. Thanks again!

Marien

Hi there guys,

I have tried to combine the tutorials for thesis header ad and rotating ads into a.. tada…. rotating header ad. As an copy & paste expert I keep getting the message ‘unexpectend ending’, have checked all the , and { }.. but don’t get it to work. Is there any real programmer out there who sees my stupidity at a glance?

Thanks in advance, Marien.

<?php

function header_ad() {

echo ' ‘;

/*Rotating Ad number 1*/
$ads = array(array(“title”=>”Thesis Wordpress Theme”,
“img” =>”http://seekingff.com/rotating-ads/wp-content/themes/thesis/custom/images/thesis.gif”,
“url” =>”http://diythemes.com/?a_aid=42091e36″,),

/*Rotating Ad number 6*/
array(“title”=>”Additional Ad”,
“img” =>”http://seekingff.com/rotating-ads/wp-content/themes/thesis/custom/images/125X125AD.gif”,
“url” =>”http://www.seekingff.com”,)
);
shuffle($ads);
$ads = array($ads[0]);

foreach($ads as $ad){
?>
<a href="”><img src="” alt=”" border=”0″/>
<?
}
echo ' ‘;
}
add_action(‘thesis_hook_header’, ‘header_ad’);

Tamir eshel

How can I include a lederboard 728×90 in the header?

Phil Barron

Check the example under ‘How to Include an Ad in Your Thesis Header’ above. It should guide you pretty well.

Carlos

I was able to post an add in the header, but how can I make them rotate, to different ads…Is there a way?

Carlos

I was able to do it with a plugin…thank you :)

Jeremy

Very helpful tutorial. Many thanks. All done, no muss no fuss.

Becky

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!

Trinidad Pena

Is there an easy way to have a banner ad above, your logo and tag line, instead of with it?

Phil Barron

Trinidad, one way to do this is to use thesis_hook_header to place the ad into the header (shown under ‘How to Include an Ad in Your Thesis Header’ further up this page), and then apply margin rules to the ad and to the header to position the ad and make space in the header to accommodate it, as shown in this (temporary) display on a test site. The CSS:

.advert {
margin-bottom:50px;
margin-top:-130px;
}

#header {
margin-top:60px;
}

Kerry

What if you want to place ads in the sidebar, but want a different ad on each page?

Manuel Molina

I would like to have the ad to show on single post and home page. How do I do that?
Thanks!

Mike

Thanks so much for this helpful post. I’m hoping you can help me one step further.

I’d like to add rotating ads to the Thesis header so I can run multiple ads that cycle through each time the page is refreshed. Can you help please?

Jim McDannald

I am trying to implement 3 125×125 ads after each post, using isocket to serve the ads. How do I code this in PHP to run the scripts from isocket or Google Ad manager?

Thanks,

Jim

Phil Barron

I don’t anything about configuring isocket, and can’t access any of its docs (as I’m not running a campaign through them). It might be that the scripts could be placed through the Embedded Scripts field in Design Options, or perhaps you’d place the scripts via a function (like the examples above). I’m just guessing though, and would need to know more about isocket to understand it better.

gilda

hello, i tried adding an ad to my header with my custom_functions.php but for some reason it’s not showing up.

this is the code i added. can i get some help in making it appear?

function header_ad() {
?>

<?php
}
add_action('thesis_hook_header', 'header_ad');

gilda

sorry, i checked it again and the code seems to work in firefox but not in safari. is that weird?

Phil Barron

Gilda, not all of your code came through. In the email copy of your comment, which I received, you had code for a link but no text or image that would appear on the page. Apart from that, your function worked on a test site of mine in Firefox. I’d suggest taking this question to the DIYthemes support forums, where you can post the code and it can be more effectively trouble…shot (troubleshooted?).

Phil Barron

A test comment

Phil Barron

A test comment

Phil Barron
Emily

Thanks for this tutorial! All of the samples are for ads that are clickable images. Will this work for an iframe ad as well?

Street

Phil,

I’ve done your workaround to get Adsense into my header, but now I can’t figure out how to place it.

The header I’ve made is 1079 x 275 pixels. What code do I need to place Adsense in the bottom center of it?

Thanks!

vivek

not able to add ad-banner after first post?? need your help and guidance to add a banner after first post??
this code doesn’t work for me

Eric

Hello,

I started using Thesis just this week, and I absolutely love it. Brilliant.

One thing I’m having a hard time setting up, however, is simply placing a 728×90 leaderboard ad at the very top of my site, above the header. I followed the steps detailed above, under “How to Include an Ad in Your Thesis Header” and was able to produce the ad, but only below the header where it conflicted with my content. My attempts to move it up by changing the top margin to a negative value, are unsuccessful so far.

Can you offer any insight as to what step I may have missed?

I was able to add ads to the Posts and Pages, using the instructions above. Very clear and very helpful, thank you!

Well happy holidays, and thanks in advance if you can help me figure out how to place a banner at the tippy top.

Cheers,

Eric

Eric

Never mind! Solved it =) Cheers and happy new year.

Suzanne

Eric — I’m trying to do the exact same thing — place a leaderboard ad above my header, at the very top of the page. Would you mind sharing how you did it? Can’t find the help I need anywhere. Thanks!

TJ McCue

Hi Phil
Have learned a ton from your contributions at the Thesis forum. Just clicked over to your blog tonight.

Quick question — what if i want to add 3 adsense units in posts? I want first one in upper left, below title. Second one midway down flush right, then last one flush left. All with text wrapping around the ad units. Tips?

What if you don’t want all 3 to appear on some posts — would it be using some of the tag or category tips you shared in this post?
Thanks!!
TJ

okisafa

how to add ads after post title??

Himanshu

awesome article. needed this badly inorder to show advertising banners.

David

Very cool, thanks for the information…learning more everyday about the benefits of thesis theme. D

Ash Nallawalla

Could you please give more examples using AdSense? e.g. the example you have with the ad after the post – how to place a block of AdSense JavaScript there?

What about the large rectangle blocks of AdSense at the top right of the post, considered by many as the best converting ad and location?

fermin

Hi I see the codes here says to include a banner add to a page or post. I have added my add before content however I want to exclude the one page so the banner ad won’t show there.

I’m having a hard time locating a code if there’s any. Can you help me?

How can I set my banner ad not to show in a simple page but to show to all other pages.

Thanks!

John Cowell

How do I put two large side by side Adsense ads below the header at the top of all pages and posts?

scott

I’m trying to figure out why I can’t get any images to display. I’ve uploaded images into my media library (do the images need to be 125×125 or will the image be resized?). I’ve also copied and pasted the correct code into the MM box and the custom.css file. But if you look at the site, you see the ad boxes on the right side bar, but no images. Any suggestions would be appreciated. Thanks…

Darrell

Just bought thesis and I love it. I am an absolute newbie and thesis makes it easy and fun. Now what margins do i need to set to get the header banner ad the opposite of Site name and tagline. Please give me the code to copy and paste. Thanks for the great support.

Alwin

how can i add adsense on homepage after first row of teaser?

Morgan

Is there a way to specify which image should appear first in the multimedia box? I am using the image rotator, but would like one of the images to always appear first. What is the easiest way to do this?

Chris Pearson

Morgan, unfortunately, the default behavior of the Multimedia Box image rotator does not allow you to specify which image will appear first.

Despite this, you can still achieve the effect you want by writing a PHP function to display images however you like. Two steps are necessary to get this function to work within the Multimedia Box:

  1. Enable the Multimedia Box hook by setting it to “Custom code” on the Design Options.
  2. Attach your new function to the Multimedia Box hook in the manner outlined below, where my_image_function represents the name of your new function:
add_action('thesis_hook_multimedia_box', 'my_image_function');

Darrell

I am a complete newbie. I am learning though. I am looking to create several unique pages and would like to offer local advertising on each page.
Is it possible to have a different ads on every page in a widget?

Thanks

shajjad

thaanks for a great tutorials. Its work fine for me. I just added Amazon banner in my header and this is really a simple work after following your guideline :)

Shajjad

Webscopia

Is there any tutorial, that would explain how to include a standard banner ad (468×6), on the Main Page, just below the ‘featured’ post? I tried searching, was not very successful.

Chris Pearson

Locate the section above entitled “How to Include Banner Ads in Your Content Column.” In that section, the code references the hook thesis_hook_after_content.

To get your banner ad to display where you’ve asked, simply change that hook reference to thesis_hook_before_content.

Chris

Hi Phil

Not sure how I place a different sidebar ad only on certain posts?

Could you help please?

Thanks

Scott Adkins

Do you guys have any information on how we can put in an Adsense block above the homepage post?

Thanks

Scott Adkins

Is it true that you can only put 3 adverts on one page for adsense?

Susie

A very complete and thorough guide on placing ads on Thesis. Been searching high and low for a good article on placing ads. Didn’t know that it is right here under my very nose. Gonna put this great resource to good use!

Tim

I’m probably a bit slow…
Please tell me what does it mean:
“Upload Ad Tile Images”
what ad images ? am i supposed to have them already?
please help
my brain hurts

Kit

Content ads are not appearing on the homepage although they appear when you hit single posts and pages. As I don’t have the technical expertise to make such high-tech changes, will appreciate some light on this. Thanks!

David

Wow Phil, what a great in-depth article on including ads in Thesis. I’m going to try some of these tips out. Thanks!

Eric

This is so helpful. Thanks Phil and thanks DIY Themes for bringing Wordpress within the reach of us content freaks who are not quite ubergeeks! Brilliant, just brilliant.

Steve

I’m not sure if this is 100% correct but it worked for me so I thought I would post it. I was trying to display code above my content box and used this code above:

function page_ad() {
if (is_page(array(‘foo’, ‘bar’)) { ?>

NEW if (is_page(array(‘foo’, ‘bar’))) { ?>

and it worked. I’m using Thesis 17 so maybe my install is different from when this was posted but it worked!

Steve

Sorry I meant to add this to my post above but can not edit it. My code was:

Old – if (is_page(array(‘foo’, ‘bar’)) { ?>

New – if (is_page(array(‘foo’, ‘bar’))) { ?>

Nancy

I think there is a typo in the code for the after post ads:

add_action(‘thesis_hook_after_post_box’, ‘after_content_ad’);

SHOULD BE:
add_action(‘thesis_hook_after_post_box’, ‘after_post_ad’);

mike

Great post. However, I’m trying to do something a tiny bit different that I can’t figure out. I’d like to have posts appear at the bottom of the sidebar. My posts usually continue past my sidebar content so there is lots of whitespace there that could be productive. Is there any way to do this?

TrinityAvatar

Hi there,
Thanks for the awesome tutorial! However, I seem to missing some salient point somewhere. I’ve pasted the coding for “include an Ad On Single Post Page” (changing the info to correspond to my site, of course) and nothing shows up on the page. Perhaps a silly question but, after I paste the coding into my custom_function.php do I need to do anything else??
Not sure this is the right place to ask this question or what further information you will need, so please let me know.
Thanks a heap! :-)
Christine

TrinityAvatar

Haven’t see your responses on this thread for a while, so don’t know if you’re still following this one?

Total Newbie question… so, once we customize the code to reflect the image location on our site, all we need to do is paste the coding into the custom_functions.php, or into a Text Widget and the ads should show up, right? Sadly, none of them are working for me… so I feel sure I’m missing something “basic” that as a newbie, I’m not getting.

Maybe I’ll post in the forum too…

bazzy

Hello,
I want to tell you about a great site I found. They pay me $4000 to read e-mail,and $20 bonus to signup
visit web sites and much more.
It’s free to join and easy to sign up! CLICK THIS
LINK TO VISIT: http://read2money.com/pages/index.php?refid=bazzy

Linas Matulis

Thank you so much! This tutorial is GOLD!.. Sidebar add is already on my page. Add after post is coming in 15 minutes.

I’m a sincere raving fan of Thesis and it’s support!.. Keep it up. ;)

Linas Matulis

Hm.. It didn’t work out with add after post – the php error:

“Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘after_content_ad’ was given in /home/a9291481/public_html/wp-includes/plugin.php on line 405″

Does anyone know how could I fix this? Thanks in advance – very appreciated.

Chris Calo

I tried:

function after_post_ad() {
?>

<?php
}
add_action('thesis_hook_after_post_box', 'after_content_ad');

and… nothing appeared on the page? Maybe a conflicting plugin?

wandisini

thanks. this is a great tips for me

rakesh

i want to display ads below my nav bar but above my posts, but dont want to leave space in the side bar. i mean after my add,there should be multimedia box, not any vacent space. for example: http://www.shoemoney.com
please help

Scott

I moved my navbar below my header using the following code:
remove_action(‘thesis_hook_before_header’,'thesis_nav_menu’);
add_action(‘thesis_hook_after_header’,'thesis_nav_menu’);

Now I want to put an ad in my post column to appear on my home page only and have it below the navbar. When I used the code you have in your post:
function header_ad() {
?>

<?php
}
add_action('thesis_hook_header', 'header_ad');

I tried fooling around with the CSS code but none of the changes seemed to make a difference. Can you help me with this?

Eddie Gear

This is an extensive list of codes for ad placements in Thesis. Can you tell me how do I do a content wrap around the ad I place using these codes?

Scarlet

Hello,

I’m still rather new to Thesis and I’m trying to insert a 250×250 banner to the right of my content on a single page. It’s an affiliate banner and even though I’ve read the information on this page, I don’t see anything on how to do this. Any help on this would be great.

Thanks,

Scarlet