广告未显示在Blogger博客上的帖子之间

问题描述 投票:0回答:1

我一直试图在我的Blogger上的帖子正文之间添加我的Google AdSense代码,但是当我添加它并导航回检查它...它不会显示afs。

blogger
1个回答
1
投票

第1步。您需要做的第一件事就是解析AdSense代码并将其转换为纯文本(在google中查看adsense脚本到文本转换器)。然后转到“模板”,单击“编辑HTML”按钮并单击代码区域内的任意位置,使用CTRL + F键搜索此标记:

<data:post.body/>

注意:您可能会多次找到它,但您需要在第二个停止。或者,如果您看不到任何更改,请测试第三个。第2步。替换为此代码:

<div expr:id='"adsmiddle1" + data:post.id'></div>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style="clear:both; margin:10px 0">
<!-- Add here the code of your ad -->
</div>
</b:if>
</b:if>
<div expr:id='"adsmiddle2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("adsmiddle1<data:post.id/>");
var obj1=document.getElementById("adsmiddle2<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>

步骤3.在您看到注释的位置添加转换后的Adsense代码,然后单击“保存模板”按钮保存更改。

注意:要使广告居中,请在AdSense代码之前和之后添加代码,如下所示:

<div style="clear:both; margin:10px 0">
<center> 
<!-- Add here the code of your ad -->
</center>
</div>

添加AdSense注释以显示广告步骤4.在创建新帖子时,在“HTML”部分中将此注释添加到您希望Google AdSense广告显示的位置:

<!-- adsense -->

例如:

This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.<br /><br /> <!-- adsense -->This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.

我真的希望这个解决方案可以帮到你

© www.soinside.com 2019 - 2024. All rights reserved.