MrinTech

Computers, Technology & More

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

Insert Ads between Wordpress Header, Posts & Sidebar

If you are blogging over Self Hosted Wordpress Blog, than this post will tell you How you can insert AD (Advertisement) Code between your Wordpress Blog Header & Posts?

wordpress advertisement

It’s recommended that you insert only 728 x 90 Leaderboard (Horizontal) code between your Wordpress Blog Header and Posts, as otherwise you whole blog theme interface will not look good!

Login to your Wordpress Dashboard and Go to Appearance>> Editor (Theme Editor), now here you have to edit Index.php, Single.php and Page.php. Now look for following Lines:

<?php get_header(); ?>

<div id=”main”>

<div id=”content”>

Now in between <?php get_header(); ?> & <div id=”main”> insert your desired Advertisement (Javascript or HTML) Code as shown below:

<?php get_header(); ?>

Insert Advertisement (like Google AdSense) Code Here

<div id=”main”>

<div id=”content”>

It’s better that you use Center Tags here. The Code with Center Tags will look as follows:

<?php get_header(); ?>

<center>

Insert Advertisement (like Google AdSense) Code Here

</center>

<div id=”main”>

<div id=”content”>

It’s all done. Now you will get the Advertisement between your Wordpress Blog Header, Posts and Sidebar! If you have any doubt with respect to this, feel free to Ask in Comments Section Below.

Note: If you only want the Advertisement to appear on Homepage, just edit Index.php. Edit accordingly for Page.php (Wordpress Pages) and Single.php (Wordpress Single Post Pages).

Related: Integrate Google AdSense for Search in Wordpress after removing the Sidebar and How to Insert AdSense Between First Post & Second Post in Wordpress?

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. Enhance your Wordpress 404 Page with Google Search
  2. Hide/Mask Affiliate Links in your Blog/Website
  3. Redirect Feeds to Feedburner/Google Feedburner in Wordpress
  4. Roundup of 10 Top & Useful Posts: Part 3
  5. Akismet is MUST for Every Wordpress Blog!
  6. Now Read Out a Blog in Robots.txt File!

August 13th, 2009 How To, Tips & Tricks, Tutorial, Web, Wordpress

7 Responses to “Insert Ads between Wordpress Header, Posts & Sidebar”

  1. Saqib on August 17, 2009 at 12:43 am

    Good post. Will try it definitely. BTW, easy adsense plugin for Wordpress is also good.

  2. Matt on September 17, 2009 at 7:44 pm

    I inserted the code but when I added before and after, it centered the ad plus a bunch of other things on the page. What can you insert so it centers the ad only?

    Also any simple code to add in a bit of space between header and the ad, then between the ad the post/sidebar?

    Thanks.

  3. Matt on September 17, 2009 at 7:45 pm

    its was meant to say “when I added ‘center’ tags before….”

  4. mrintech on September 17, 2009 at 8:11 pm

    Hello Friend,

    First of all Let me see your Wordpress Blog, give me your Blog Address :) Also if possible E-mail me your index.php and single.php files using the Contact Page

    Thanks :)

  5. Carlos Guevara on September 29, 2009 at 1:55 pm

    Thanks a lot you solve my Problems

  6. Matt on September 29, 2009 at 11:32 pm

    I got it working all ok, I put a Div Style command in to centre the ad.

    Thanks for this article, its great.

  7. mrintech on September 29, 2009 at 11:46 pm

    Glad to know that it worked :)

    Mrintech Recommends Hostgator Webhosting

Comments are closed.

    Translate
    Subscribe

    Subscribe to Mrintech

    Advertisement
    We Recommend:

    Mrintech Recommends Hostgator Webhosting

    Sites We Like
    • A Quizzical Reality…
    • BT Elements
    • iTech7
    • Leased Line
    • MPLS
    • Phoenix: Anirudh's Blog
    • SDSL
    • 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