WP Hack: Adding banner (ad) after the first post

Posted in » WordPress - by Ades on December 24th, 2007

New to this blog? See our Popular Posts section to get started, we have tons of great articles that can benefit you. Don't miss the upcoming interesting articles, subscribe to our RSS.

Sometimes you just want to add one ad (banner) in your blog, and you want it to be after the first post. If you wanted to do that, here is a quick fix:

wordpress, adding banner ad after the first post

As you can see from the screenshot above, you will need to find your “Read More” code in index.php (Presentation > Theme Editor > Main Index Template). After you have found it, insert this code below:

<?php if ($count == 0) : ?>

paste your ad code here

<?php endif; $count++; ?>

Replace the text “paste your ad code here” with your own ad code and save your index.php.

That’s it! This small code will display your ads after the first post only.

Thanks to onemansblog.com


Related Posts





7 Responses to “WP Hack: Adding banner (ad) after the first post”

  1. By xBrain on Dec 24, 2007

    Hi Ades,

    Thanx for the tips. I had search this info for quite sometimes. Need to put the nuffnang ads.

    Btw Ades, I had a talk with Tim about the nuffnang ads are not done well in your blog and he says because the unique visitors that you received mostly from outside, not local.

    Hope that info will help..

  2. By Shawal on Dec 24, 2007

    Thanks Ades for this simple tutorial.. I’ve been looking for this a quit time….

  3. By Ades on Dec 25, 2007

    xBrain, yes that might be the case with nuffnang. But anyway the performance was still weak compared to other programs.

  4. By Michael on Jan 3, 2008

    Implemented on my blog immediately, wonderful tip!

  5. By Make Money Online on Feb 21, 2008

    Top tip. Just got to find that code now. LOL

  6. By FACTOR2 on Feb 29, 2008

    Thank You.Good script

  7. By PS3 on Mar 14, 2008

    Thanks for the heads up, that will sure save a bit of time.

FREE eBook: "Blog Profits Blueprint" by Yaro Starak. download here.

Post a Comment