MrinTech

Computers, Technology & More

  • Home
  • Subscribe
  • About
  • Contact
  • Blog Archive
  • Disclaimer
  • Privacy

How to Insert Ads Between First Post and Second Post in WordPress?

A Few Days Back I wrote about How to Remove WordPress Theme Sidebars and Integrate Google Adsense Search within your Blog.

insert-post-between-first-post-and-second-post

Now Here’s another small Template Hack/Trick for Displaying Advertisement Between First Post and Second Post in WordPress (Refer Image above).

HostGator
Follow these simple steps:

  • Navigate to Design/Appearance Tab
  • Choose Theme Editor
  • Go to Index.php
  • Now search for the following line in it:

<?php endwhile; ?>

  • Now Immediately above this place the following lines:

<?php if(!$show_ads){ ?>
Insert Advertisement Code Here
<?php $show_ads = 1; } ?>

  • Moreover, you can align the placement of this Advertisement to Center simply by using <center> tag as shown below:

<center>

<?php if(!$show_ads){ ?>
Insert Advertisement Code Here
<?php $show_ads = 1; } ?>

</center>

It’s all Done.

Note: This template trick/hack is only applicable for WordPress Self Hosted Blog Users, this will not work for Blogs hosted on WordPress.com

[via]

Liked this Post? Get free Quality Updates in your Inbox. Please Enter your E-mail Address Below OR For More Subscription Options Click Here

Sharing is Caring
  • Facebook
  • Twitter
  • del.icio.us
  • StumbleUpon
  • Google Bookmarks
  • Reddit
  • FriendFeed
  • blogmarks
  • Digg

Related posts:

  1. Insert Ads between WordPress Header, Posts & Sidebar
  2. Enhance your WordPress 404 Page with Google Search
  3. Remove Sidebar & Add Google AdSense Search within your WordPress Blog
  4. How to Apply for Guruji Ads Network?
  5. Hide/Mask Affiliate Links in your Blog/Website
  6. Akismet is MUST for Every WordPress Blog!
  7. How to Track WordPress Blog Visitors in Real Time from Dashboard?
  8. Now Read Out a Blog in Robots.txt File!
  9. Create/Generate Image XML Sitemap for WordPress Blog
  10. WordPress XML and XHTML Sitemap

January 20th, 2009 How To, Tutorial, Web, Wordpress
Loading

2 Responses to “How to Insert Ads Between First Post and Second Post in WordPress?”

  1. Ajinkya on March 19, 2009 at 10:22 pm

    hey thanks,

    i done this tut, it helped me. u can chk the DEMO here: http://gfxtutor.co.cc/?p=15

    cya

  2. Southspice on July 23, 2009 at 12:04 pm

    Nice tips with easy understanding is the highlight of this article. Better I bookmark this page @ http://desidigg.slinkset.com for all my friends & members of this site.

Comments are closed.

    Subscribe

    Subscribe to Mrintech

    Advertisement
    Sites We Like
    • BollyGeek
    • iTech7
    • Leased Lines
    • Phoenix: Anirudh's Blog
    • Polycom Soundstation 2
    • SDSL
    • VPN
    • What's On My PC
Home | About | Contact | Advertise | Web Hosting | Connect With Us | Sitemap | Disclaimer | Privacy
Copyright © MrinTech. Performancing's Treasure Theme by Randa Clay. Proudly powered by WordPress