1、zblogphp版文章页调用不同侧栏的方法
zblogphp版文章页是调用的single.php单独模板,所以修改比较简单
在后台找到“模块管理”,选择 “默认侧栏”(对应的模板文件夹下的sitebar.php文件),直接增加和删除修改模块即可
2、zblogphp版实现首页、分类页列表页实现调用不同侧栏的解决办法
zblogphp版首页、分类列表页面调用的是相同的模板index.php,那么要想实现首页和列表页调用不同侧栏,就需要用代码实现分离,也就是加一个判断语句。具体操作如下:
首先:在后台找到“模块管理”
选择 “侧栏2”(对应的模板文件夹下的sitebar2.php文件),可以将此侧栏修改成首页调用侧栏;
选择 “侧栏3”(对应的模板文件夹下的sitebar3.php文件),可以将此侧栏修改成分类列表页调用侧栏。
然后:打开当前使用的zblogphp模板下compile文件夹,找到index.php,复制成三个,按照下面的说明更改后,保存
一个改名为:index_default.php,并将代码<?php include $this->GetTemplate('sidebar'); ?> 修改为 <?php include $this->GetTemplate('sidebar2'); ?>
另一个改名为:index_list.php,并将代码<?php include $this->GetTemplate('sidebar'); ?> 修改为 <?php include $this->GetTemplate('sidebar3'); ?>
最后一个名字仍为:index.php,但是将代码清空,将如下代码复制进去:
<?php include $this->GetTemplate('index_default'); ?>
<?php include $this->GetTemplate('index_list'); ?>
最后,上传三个文档。
重新打开您的网站看一下,是不是已经实现了侧栏的不同调用!
加入ps修图技术学习 QQ群231015465 mastercam QQ群189967710(收费) mastercamQQ群651977295 买教程联系QQ1259375976 收费安装软件加QQ1363172104