由于是学财务的,没什么技术水平,全部采用最原始的办法,沿用wordpress文章列表加广告的用法,想法:设置0-9个广告js文件,根据文章id各位数调用0-9.js
1.在index.pph文件中<?php while($this->next()): ?>下面加
<?php $count = 1; ?>
2.在<div class=content>后面加
<div id="ads">
<?php if ($count == 1) : ?>
<?php
$ads=substr($this->theId,-1);
echo"<script src=http://www.xxxxxx.com/blogads/$ads.js></script>";
?>
<?php endif; $count++; ?>
</div>
3.style.ccs加上
#ads{
float: left;
margin-right: 10px;
}
演示:http://www.youcains.com
在文章列表摘要左侧内加随机广告
版主: woniou