Home > php教程 > php手册 > body text

wordpress只在首页显示友情链接方法

WBOY
Release: 2016-06-21 08:56:20
Original
1240 people have browsed it

wordpress博客如何只在首页显示友情链接,不在分页显示,用这个方法就行。

1.找到wp-content/themes/您正在使用的模板。
2.打开sidebar.php,好像各个版本的侧边都是这个文件名,可以用Dreamweaver打开,也可以用记事本,总之能打开就行。。。
3.找下友情链接这几个字,或者找下is_home,然后按下面的方法修改:



友情链接


    ’, ‘’, ”, TRUE, ‘url’, FALSE); ?>



每个模板的样式代码名字都不同,可参照您sidebar.php这个文件上面的样式代码来改,比如热评文章或者最新评论的样式代码。只要在is_home()后面加上这个&&!is_paged()条件就行,要满足在首页并且不在分页的这个条件下,才显示友情链接。
本文sky ( www.zzjs.net ) 原创编辑,请遵守行业规则,转载保留版权。



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!