
wordpress天生的功能真是弱啊,全靠插件阿,改代码啊。之前7788改了不少了,还好懂这些代码。最近发现友情链接原生的不能控制排序,看了下网上的分享,结合自己的要求成功了。
步骤其实很简单:
1、在控制面板/链接,把每个链接编辑一下等级(编辑界面最下方有这个下拉框,1最重要,9最不重要)
2、在控制面板/外观/编辑,选择sidebar.php文件,插入以下代码,就大功告成。
<li><h3>友情链接</h3>
<ul>
<?php get_links(2, ‘<li>’, ‘</li>’, ”, TRUE, ‘rating’, FALSE); ?>
</ul>
</li>
其中的“rating”可以根据你的需要换成“id”,“url”等等排序方式。
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com
You can find more information in our Cookie Policy and Cookie Policy.
3 Comments
你好
<?php get_links_list(‘youqinglianjie’,”,”,”,false,’rating’); ?>
这是我现在使用的代码,我想让页面只显示“友情链接”不显示上面的“链接表”,因为看着太乱了,也不是我想要的,
请问代码该怎么改啊?
谢谢
连接表是什么?我可能已经改了有点忘记了。你根据我文章中的代码来改是不是可以呢?
我看好你哦