.NET Assembly FAQ - Part 3 - Strong Names and Signing C# GetPixel and SetPixel
Jun 19

The leading SEO (Search Engine Optimization) sites will tell you that placing an ad after the first post in your blog's home page is particularly effective.  This is because the ad is essentially embedded in the blog content, hence your readers are less likely to develop "ad blindness" and skip over the ad as usual.

To place an ad after the first post in your WordPress blog main page:


  1. Open the WordPress admin control panel and navigate to:
    Presentation > Theme Editor
     
  2. Select the Main Index Template from the list of templates on the right.
     
  3. In the Main Index Template, find the line that starts with:
    <?php if (have_posts())
     
  4. Add the following line above it:
    <?php $count = 1; ?>
     
  5. Next, find the line that starts with:
    <?php the_content
     
  6. After the closing tag ?> for that section (it may wrap to multiple lines), add the following code:

    <?php if ($count == 1) : ?>
    – Insert your Google AdSense code here –
    <?php endif; $count++; ?>

  7. Click Update File.

This places the ad within the first post.  If instead you want the ad to appear between the first and second post, add the code from step 6 after the closing </div> tag for the "entry" div that contains the line <?php the_content.

Popularity: 4% [?]


Copyright © 2007-8 Tiwebb Ltd. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without explicit permission from Tiwebb Ltd.

kick it on DotNetKicks.com   

Tags: , , , , , ,

10 Responses to “Embed Google Ad in First WordPress Post”

  1. Mastering Your WordPress Theme Hacks and Techniques Says:

    […] 2)Embed Google Ad in First WordPress Post- One of the more effective places to implement Google Adsense is after the first post, so you want to prevent your ad code from appearing after every single post, as WordPress would just loop and keep showing it. All you need to do is add this code inside the loop. […]

  2. 精通Wordpress系列教程- 1: 精通Wordpress主题Hacks与技巧 | 帕兰映像 Says:

    […] 1)Modifying Individual Posts In The Loop/修改Loop循环里面的单独日志样式- 有的时候客户有一些特别的要求,比如要让Google广告插入显示为页面中的第二篇日志,或顶部日志使用不同的背景颜色, 而其它日志只显示标题. 如果只使用一个Loop你不能完成这些工作, 这篇文章将教会如何使用不同的loops显示不同的日志风格.2)Embed Google Ad in First WordPress Post/在第一篇日志中插入Google广告-其中一个比较实用的地方就是让Google广告显示在第一篇日志后面,而不是每篇日志后面都显示。你可以使用下面的代码实现此效果: […]

  3. 精通Wordpress主题-2: 在Wordpress第一篇日志中插入广告的方法 | 帕兰映像 Says:

    […] 原文:Embed Google Ad in First WordPress Post 翻译: 帕兰 […]

  4. Hijack Says:

    Would it be possible to show Ads in the first two posts at the same time?

  5. Future of web standards (my take) Says:

    […] 2)Embed Google Ad in First WordPress Post- One of the more effective places to implement Google Adsense is after the first post, so you want to prevent your ad code from appearing after every single post, as WordPress would just loop and keep showing it. All you need to do is add this code inside the loop. […]

  6. paidnetpedia.com Says:

    […] 2)Embed Google Ad in First WordPress Post- One of the more effective places to implement Google Adsense is after the first post, so you want to prevent your ad code from appearing after every single post, as WordPress would just loop and keep showing it. All you need to do is add this code inside the loop. […]

  7. Embed Google Ad in First WordPress Post Says:

    […] Embed Google Ad in First WordPress Post […]

  8. 在Wordpress第一篇日志中插入广告的方法 Says:

    […] 原文:Embed Google Ad in First WordPress Post No Related Post wordpress […]

  9. SEO & Web Design » Blog Archive » Mastering Your WordPress Theme Hacks and Techniques Says:

    […] 2)Embed Google Ad in First WordPress Post- One of the more effective places to implement Google Adsense is after the first post, so you want to prevent your ad code from appearing after every single post, as WordPress would just loop and keep showing it. All you need to do is add this code inside the loop. […]

  10. SEO & Web Design » Blog Archive » Mastering Your WordPress Theme Hacks and Techniques Says:

    […] 2)Embed Google Ad in First WordPress Post- One of the more effective places to implement Google Adsense is after the first post, so you want to prevent your ad code from appearing after every single post, as WordPress would just loop and keep showing it. All you need to do is add this code inside the loop. […]

Leave a Reply