年年我发



返回   年年我发 > 网站建设 > 建站交流 > Blog(博客)/Wiki(维客)/RSS/Cms
用户名
密码
 
注册账号 论坛帮助 会员列表 日历事件网赚工具 标记版面已读

Blog(博客)/Wiki(维客)/RSS/Cms Blog(博客)/、Wiki(维客)、RSS、Cms等WEB 2.0相关技术讨论专区。

回复
 
主题工具 搜索本主题 显示模式
  #1   IP: 218.85.132.244
旧 2008-02-19, 02:33 AM
car car 当前离线
高级会员
 
注册日期: 2006-05-14
帖子: 445
精华: 0
现金: 4811 元
资产: 4811 元
声望: 10 car 正向着好的方向发展
默认 How To Put Ads on WordPress Home Page Only

Folks, since my site has gotten fairly popular I have people who want to advertise on the home page. The problem is that I didn’t know of a good method of embedding Ads that only show up on the home page and don’t appear site wide. (And not in the sidebar.)

I needed to employ a little PHP trickery in order to get this to work and I figured I’d share the methodology in case anyone else wanted to do this, or had a better idea as to how to pull it off.

In my case what I did was edit the Index.php file and added the following code to the bottom of the page inside the loop:

代码:
<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> PLACE ADVERTISEMENT HERE. <?php } ?>
What this does is causes the ads to appear on the Homepage, but not on any of the other Category or Archive “pages”.
回复时引用此帖

wellcome to www.0058.net
回复


当前查看此主题的会员: 1 (0 位会员和 1 位游客)
 
主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

论坛启用 BB 代码
论坛禁用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
论坛跳转

相似的主题
主题 主题作者 版面 回复 最后发表
What are the Strongest Directories? smiling 网站链接开发 1 2007-07-28 09:26 PM
13 AdSense Mistakes that get you Baned sunshine Google Adsense 0 2007-05-09 08:28 PM
List of high paying Keywords whose cpc is greater than $20 sunshine Google Adsense 1 2007-05-09 08:16 PM
The secret to perfectly-targeted ads! indianboy Google Adsense 1 2006-04-28 05:04 AM
Building for the user and the bot. admin 建站交流 0 2006-01-17 03:54 PM


所有时间均为北京时间. 现在的时间是 05:24 PM, Free Patent & Patent Ideas


Powered by vBulletin 3.5.2 Chinese Exhibition Happy New Year
©2000 - 2008,Jelsoft Enterprises Ltd  Desiccant Molecular Sieve Weight Loss Bentonite Trade Manager