This is a very simple plugin that uses Javascript to form a collapsable set of
这是一个非常简单的插件,使用Javascript构成了一组可折叠的
links in the sidebar for the links (blogroll).
链接的侧边栏中的链接(博客)。
Every link corresponding to a
每个链接对应一个
given link category will be expanded.
给定的链接类别将得到扩展。 p>
You can use multiple instances of the widget, each with its own set of options.
您可以使用窗口小部件的多个实例,每个实例都有其自己的一组选项。
In this way you could have one set of links for certain categories one place on your page, and another widget with a different set of links somewhere else.
这样,您可以在页面的一个位置上拥有一组特定类别的链接,而在其他位置拥有另一个具有一组不同链接的小部件。 p>
It is based off of the Collapsing Categories and Collapsing Pages plugins.
它基于“折叠类别”和“折叠页面”插件。 p>
What’s new?
有什么新消息? h4>
0.4 (2015.08.12)
0.4(2015.08.12) p>
- Compatible with WP 4.3
- 与WP 4.3兼容 li>
ul>
li>
0.3.5 (2010.06.23)
0.3.5(2010.06.23) p>
- Fixed javascript path error
- 修复了javascript路径错误 li>
ul>
li>
0.3.4 (2010.06.18)
0.3.4(2010.06.18) p>
- Fixed html validation when target is blank (thanks http://dropdeaddick.com)
- 在目标为空时修复了html验证(感谢http://dropdeaddick.com) li>
ul>
li>
0.3.3 (2010.01.28)
0.3.3(2010.01.28) p>
li>
ul>
Options
选项 h3>
Style options can be set via the settings panel.
可以通过设置面板设置样式选项。
All other options can be set
可以设置所有其他选项
from the widget panel.
从小部件面板中。
If you wish to insert the code into your theme manually
如果您希望将代码手动插入主题中
instead of using a widget, you can use the following options.
除了使用小部件,您还可以使用以下选项。
These options
这些选项
can be given to the collapsLink()
function either as an array or in query
可以作为数组或在查询中赋予 collapsLink() code>函数
style, in the same manner as the wp_list_links
function.
样式,与 wp_list_links code>函数的方式相同。 p> $defaults=array( $ defaults = array( 'showLinkCount'=> true ,
'showLinkCount'=> true,
'catSort'=> 'linkName' ,
'catSort'=>'linkName',
'catSortOrder'=> 'ASC' ,
'catSortOrder'=>'ASC',
'linkSort'=> 'linkName' ,
'linkSort'=>'linkName',
'linkSortOrder'=> 'ASC' ,
'linkSortOrder'=>'ASC',
'inExclude'=> 'exclude' ,
'inExclude'=>'exclude',
'inExcludeCats'=> '' ,
'inExcludeCats'=>'',
'expand'=> 0 ,
'expand'=> 0,
'customExpand' => '',
'customExpand'=>'',
'customCollapse' => '',
'customCollapse'=>'',
'defaultExpand'=> '',
'defaultExpand'=>'',
'animate' => 0,
'animate'=> 0,
'nofollow' => true,
'nofollow'=>是,
'debug' => false
'调试'=>否
);
);
code> pre>
- showLinkCount
- showLinkCount
li>
- catSort
- catSort
- The order in which link categories should be sorted.
- 链接类别的排序顺序。
Possible values:
可能的值:
- ‘catName’ the name of the link category (default)
- “ catName”链接类别的名称(默认) li>
- ‘catId’ the id of the link category
- “ catId”链接类别的ID li>
- ‘catSlug’ the slug of the link category
- “ catSlug”链接类别的条目 li>
- ‘catOrder’ custom order specified in the links options
在链接选项中指定的
- “ catOrder”自定义订单 li>
- ‘catCount’ the number of links in each category
- “ catCount”每个类别中的链接数 li>
ul>
li>
ul>
li>
- linkSort
- linkSort
- The order in which link linkegories should be sorted.
- 链接链接类别的排序顺序。
Possible values:
可能的值:
- ‘linkName’ the name of the link (default)
- “ linkName”链接的名称(默认) li>
- ‘linkId’ the id of the link
- “ linkId”链接的ID li>
- ‘linkUrl’ the url of the link
- “ linkUrl”链接的网址 li>
- ‘linkRating’ the rating assigned to the link
- “ linkRating”分配给链接的评分 li>
ul>
li>
ul>
li>
- catSortOrder
- catSortOrder
- Whether categories should be sorted in normal or reverse order.
- 类别应按正序还是反向排序。
Possible
可能
values:
值: p>
- ‘ASC’ normal order (a-z, 0-9) (default)
- “ ASC”正常顺序(a-z,0-9)(默认) li>
- ‘DESC’ reverse order (z-a, 9-0)
- “ DESC”反向顺序(z-a,9-0) li>
ul>
li>
ul>
li>
- linkSortOrder
- linkSortOrder
- Whether link should be sorted in normal or reverse order.
- 链接应按正序还是反向排序。
Possible values:
可能的值:
- ‘ASC’ normal order (a-z, 0-9) (default)
- “ ASC”正常顺序(a-z,0-9)(默认) li>
- ‘DESC’ reverse order (z-a, 9-0)
- “ DESC”反向顺序(z-a,9-0) li>
ul>
li>
ul>
li>
- inExclude
- in排除
- Whether to include or exclude certain categories
- 是否包括或排除某些类别
- ‘exclude’ (default)
- “排除”(默认) li>
- ‘include’
- “包含” li>
ul>
li>
ul>
li>
- inExcludeCats
- inExcludeCats
- The link categories which should be included or excluded
- 应包含或排除的链接类别 li>
ul>
li>
- expand
- 展开
- The symbols to be used to mark expanding and collapsing.
- 用于标记展开和折叠的符号。
Possible values:
可能的值:
- ‘0’ Triangles (default)
- “ 0”个三角形(默认值) li>
- ‘1’ + –
- ‘1’+ – li>
- ‘2’ [+] [-]
- ‘2’[+] [-] li>
- ‘3’ images (you can upload your own if you wish)
- “ 3”张图片(如果需要,您可以上传自己的图片) li>
- ‘4’ custom symbols
- “ 4”个自定义符号 li>
ul>
li>
ul>
li>
- customExpand
- customExpand
li>
customCollapse
customCollapse p>
li>
defaultExpand
defaultExpand p>
- A comma separated list of link category IDs or Slugs which should be
- 以逗号分隔的链接类别ID或Slug列表,应为
expanded by default
默认展开 li>
ul>
li>
- animate
- 动画
- When set to true, collapsing and expanding will be animated
- 设置为true时,折叠和展开将被动画化 li>
ul>
li>
- nofollow
- nofollow
- When set to true (default), rel=’nofollow’ tags will be added to links
- 设置为true(默认值)时,会将rel ='nofollow'标签添加到链接中 li>
ul>
li>
- debug
- 调试
li>
ul>
Examples
示例 h4>
collapsLink('animate=true&nofollow=false&expand=3,inExcludeCats=blogroll,lousy-friends') collapsLink('animate = true&nofollow = false&expand = 3,inExcludeCats = blogroll,糟糕的朋友')
code> pre>
This will produce a list with:
这将产生带有以下内容的列表:
* animation on
*动画
* no nofollow tags
*没有nofollow标签
* using images to mark collapsing and expanding
*使用图像标记折叠和展开
* exclude links in the categories blogroll and lousy-friends
*排除类别Blogroll和糟糕的朋友中的链接 p>
Demo
演示 h3>
You can see this on my test blog at http:/obfelty.com/test
您可以在http:/obfelty.com/test p>的测试博客上看到此内容
CAVEAT
CAVEAT h3>
Currently this plugin relies on Javascript to expand and collapse the links.
当前,该插件依赖Javascript来扩展和折叠链接。
If a user’s browser doesn’t support javascript they won’t see the links to the
如果用户的浏览器不支持javascript,则不会看到指向
的链接
posts, but the links to the links will still work (which is the default
帖子,但指向链接的链接仍然有效(这是默认设置
behavior in wordpress anyways)
反而在wordpress中的行为) p>
The option to show the number of links currently uses the number stored in the
用于显示当前链接数的选项使用存储在
中的数字
database, which includes both visible and invisible links.
数据库,其中包括可见链接和不可见链接。
If you have
如果您有
invisible links, this number will be wrong.
看不见的链接,这个数字是错误的。 p>