Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

How do I insert an Adsense ad after the first post on the page only?


  #1  
Old Feb 14, 2009, 08:09 PM
jonco
 
9 posts · Feb 2009
I want to put an Adsense ad after the first post (only) on a page. How, and where can I do that?
Thanks for the help.

Jonco

BTW: I Also made a donation to BFA in consideration of this great WordPress theme.
  #2  
Old Feb 14, 2009, 09:36 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Thank you, the donation might not have gone through. At least I didn't get one today and the last one from yesterday was from someone else. See also bottom fo this thread http://forum.bytesforall.com/showthread.php?t=384

I will get back to you about the ads tomorrow, I am leaving for today
  #3  
Old Feb 15, 2009, 09:24 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
If you're running version 3.2 you should already have $postcount in index.php.
For the ad, put the code below into index.php, for instance before or after

PHP Code:
        </div><!-- / Post --> 
depending on whether you want to put it inside or outside the post container.

PHP Code:
<?php if ( (is_home() OR is_archive()) AND $postcount <= 1) { ?>
AD CODE
<?php ?>
is_archive covers Category, Tag, Author and Date based multi post pages.
is_home covers the home page (if a static page is set as homepage then only the homepage of posts) including page 2, page 3 etc.

Bookmarks

Tags
adsense



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert external Link into Page Menu at a specific place mrz Page & Category Menu Bars 3 Jan 16, 2010 10:16 PM
[SOLVED] Next post and previous post links on top of single post page error susieswe Atahualpa 3 Wordpress theme 2 Jul 15, 2009 02:58 PM
Insert Google Adsense Section Targetting RibaRiva Forum How-To 0 May 19, 2009 11:13 AM
AdSense Question Jerry Atahualpa 3 Wordpress theme 1 Feb 21, 2009 04:24 AM
Post / Page Info Items - Button crashes comp, how do I add to post-footer? Image help everygirlssecret Post-Kicker, -Byline & -Footer 1 Jan 5, 2009 01:12 PM


All times are GMT -6. The time now is 04:51 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.