问:如何在anqicms首页的文章列表的开始和结束位置添加广告位?
答:在anqicms的首页的文章列表里的开始和结束位置添加广告,和其他位置差不多,有两个地方需要操作,一个是模板文件里面添加广告的调用代码,另一个就是在全局自定义参数里面,添加具体的广告代码。详细操作方法如下:
1、首页模板index/index.html里面搜索下面代码:
<div class="post-list">
{% archiveList articles with type="list" limit="30" %}
{%- for item in articles %}
我的自己改成了30了,默认的是10,即默认的代码是
<div class="post-list">
{% archiveList articles with type="list" limit="10" %}
{%- for item in articles %}
在这三行代码的上一行,添加广告调用代码:
<div class="post-item">{% system with name="Sywzlbksgg" %}</div>
注:Sywzlbksgg的含义是 首页文章列表开始广告。
2、添加广告代码。
在网站后台,【后台设置】,下的【全局设置】,最底部,有一个【自定义参数】,我们点击【添加参数】即可。
参数名:Sywzlbksgg
备注:首页文章列表开始广告
参数值:(填写你的广告代码)
我下面的代码,供大家参考吧:
<div>
<a href="https://www.olzz.com/yzywlfw.html target="_blank">站长在线站长一对一网络指导服务,一元一分钟,50元一个小时</a> <br>
<a href="https://www.olzz.com/jinganmeiguoxunizhuji.html target="_blank"> 永久美国免备案虚拟主机1元1天,15元1月,100元1年,1000元永久</a> <br>
<a href="https://daan.olzz.com"/ target="_blank"> 站长在线旗下答案网站,全站所有题目,免费查看答案和答案解析</a>
</div>
同理,文章列表开头广告,添加完毕了,就添加文章列表结束广告了。
3、首页模板index/index.html里面搜索下面代码:
{% endfor %}
{% endarchiveList %}
</div>
在这个代码的后面添加,广告调用代码:
<div class="post-item">{% system with name="Sywzlbjsgg" %}</div>
添加以后,该区域的代码如下:
{% endfor %}
{% endarchiveList %}
</div>
<div class="post-item">{% system with name="Sywzlbjsgg" %}</div>
</div>
{% include "partial/sidebar.html" %}
</div>
{% endblock %}
4、添加广告代码。
在网站后台,【后台设置】,下的【全局设置】,最底部,有一个【自定义参数】,我们点击【添加参数】即可。
参数名:Sywzlbjsgg
备注:首页文章列表结束广告
参数值:(填写你的广告代码)
我下面的代码,供大家参考吧:
<div>
<a href="/anqicmsolzzcom.html" target="_blank">本站网站模板,仅售50元,点击查看</a> <br>
<a href="https://www.olzz.com/jinganmeiguoxunizhuji.html" target="_blank"> 永久美国免备案虚拟主机1元1天,15元1月,100元1年,1000元永久</a> <br>
<a href="https://www.olzz.com" target="_blank"> 站长在线,建一个网站创一番事业</a>
</div>