Adsense广告显示问题
Adsense ads display issue
广告没有出现在与2个类别相关的特定2个页面中,这些类别包含最新文章和阅读量最高的文章,其他类别使用管理面板添加,只有在撰写文章时指定了类别(或从数据库),文章才会链接php代码中的内容可能会使广告不会只出现在这两个类别中。请列出php和javascript等冲突的可能原因。或者可能是需要从主机加载一些php或apache扩展。。
//Update//广告显示在localhost中,但不显示在远程服务器上//但请注意,只有这两个动态类别没有显示广告;加载了php,如下所示:
热门文章
// Popular articles link
$popular_li_class = '';
if ($show_popular)
{
$popular_li_class = ' class="selectedcat" ';
}
if (_SEOMOD)
{
$output = '<li '. $popular_li_class .'><a href="'. _URL .'/articles/popular-01.'. _FEXT .'">'.$lang['articles_mostread'].'</a></li>'. $output;
}
else
{
$output = '<li '. $popular_li_class .'><a href="'. _URL .'/article.php?show=popular">'.$lang['articles_mostread'].'</a></li>'. $output;
}
最新文章类别:
// wrapper
$output = '<li><a href="'. _URL .'/article.'. _FEXT .'">'.$lang['articles_latest'].'</a></li>'. $output;
// wrapper
if ($ul_wrapper)
{
$output = "<ul id='ul_categories'>'n$output'n</ul>";
}
return $output;
}
任何帮助都将不胜感激。谢谢
Adsense代码只是包含在<script></script>
标记中的javascript代码。如果您的php代码生成包含此代码的html,则它会正确加载到客户端的浏览器上,并显示广告。检查php代码是否包含任何阻止javascript代码输出的错误。您可以检查生成的源代码。
显示adsense代码就像在php代码中写以下内容一样简单:
include_once("adsense1.php");
其中adsense1.php包含:
<script type="text/javascript"><!--
google_ad_client = "ca-pub-";
google_ad_slot = "xxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
或者,你甚至可以这样做:
<?php
print '<script type="text/javascript"><!--
google_ad_client = "ca-pub-";
google_ad_slot = "xxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';
?>
相关文章:
- angular js密码强度显示问题
- JQuery上下文菜单显示/隐藏问题
- AngularJs基于角色的菜单显示安全问题
- ajax显示隐藏滚动到最重要的问题
- 如何解决youtube播放器没有显示全宽的问题&身高
- 在 AngularJS 中显示信息的标记存在问题
- 有问题的突出显示(悬停)一个系列,突出显示图表
- 挖空和显示模块模式的数据绑定问题
- 使用 jQuery UI 折叠面板显示 couchDB 数据库搜索结果时出现问题
- 问题 - 在查询加载器 2 加载页面之前显示 1 秒的页面
- 显示脸书好友个人资料图片时出现问题
- 搜索输入问题显示滚动
- HTML:密码字段中的HTML5占位符属性问题 - 显示正常文本
- AngularJS+simpleCart问题显示购物车内容,直到添加项目
- 问题显示twitter状态/user_timeline MVC3.Net
- 通过jQuery将某些问题显示在html表单上
- 有问题显示数据到html表使用ajax和php
- 随机问题显示下载链接
- Chrome和谷歌网页字体的问题.显示来自Firefox的不同输出
- Ext js网格问题显示日期在safari