This is a relatively simple plugin that uses Javascript to
这是一个使用Javascript的相对简单的插件,
make the Archive links in the sidebar collapsable by year and/or month.
使边栏中的“存档”链接可以按年份和/或月份折叠。 p>
Demo
演示 h3>
I use this plugin in my blog at http://blog.robfelty.com
我在http://blog.robfelty.com的博客中使用了此插件 p>
OPTIONS AND CONFIGURATIONS
选项和配置 h3>
$defaults=array( $ defaults = array( 'noTitle' => '',
'noTitle'=>'',
'inExcludeCat' => 'exclude',
'inExcludeCat'=>'排除',
'inExcludeCats' => '',
'inExcludeCats'=>'',
'inExcludeYear' => 'exclude',
'inExcludeYear'=>'排除',
'inExcludeYears' => '',
'inExcludeYears'=>'',
'sort' => 'DESC',
'sort'=>'DESC',
'showPages' => false,
'showPages'=>否,
'linkToArch' => true,
'linkToArch'=>是,
'showYearCount' => true,
'showYearCount'=>是,
'expandCurrentYear' => true,
'expandCurrentYear'=>是,
'expandMonths' => true,
'expandMonths'=>是,
'expandYears' => true,
'expandYears'=>是,
'expandCurrentMonth' => true,
'expandCurrentMonth'=>是,
'showMonthCount' => true,
'showMonthCount'=>是,
'showPostTitle' => true,
'showPostTitle'=>是,
'expand' => '0',
'展开'=>'0',
'showPostDate' => false,
'showPostDate'=>否,
'postDateFormat' => 'm/d',
'postDateFormat'=>'m / d',
'postDateAppenc' => 'after',
'postDateAppenc'=>'之后',
'accordion' => 0,
'手风琴'=> 0,
'postTitleLength' => '',
'postTitleLength'=>'',
'post_type' => 'post',
'post_type'=>'post',
'debug' => '0',
'调试'=>'0',
);
);
code> pre>
- noTitle
- noTitle
- If your posts don’t have title, specify a string to show in place of the
- 如果您的帖子没有标题,请指定一个字符串以代替
title
标题 li>
ul>
li>
- inExcludeCat
- inExcludeCat
- Whether to include or exclude certain categories
- 是否包括或排除某些类别
- ‘exclude’ (default)
- “排除”(默认) li>
- ‘include’
- “包含” li>
ul>
li>
ul>
li>
- inExcludeCats
- inExcludeCats
- The categories which should be included or excluded
- 应包括或排除的类别 li>
ul>
li>
- inExcludeYear
- 在ExcludeYear
- Whether to include or exclude certain years
- 是否包括或排除某些年份
- ‘exclude’ (default)
- “排除”(默认) li>
- ‘include’
- “包含” li>
ul>
li>
ul>
li>
- inExcludeYears
- 在不包括年份
- The years which should be included or excluded
- 应包含或排除的年份 li>
ul>
li>
- showPages
- showPages
- Whether or not to include pages as well as posts.
- 是否包括页面和帖子。
Default if false
默认为false li>
ul>
li>
- showYearCount
- showYearCount
- When true, the number of posts in the year will be shown in parentheses
- 为true时,一年中的帖子数将显示在括号中 li>
ul>
li>
- showMonthCount
- showMonthCount
- When true, the number of posts in the month will be shown in parentheses
- 为true时,该月的帖子数将显示在括号中 li>
ul>
li>
- linkToArch
- linkToArch
- 1 (true), clicking on a the month or year will link to the archive (default)
- 1(true),单击月份或年份将链接到存档(默认) li>
- 0 (false), clicking on a month or year expands and collapses
- 0(否),单击月份或年份会展开和折叠 li>
ul>
li>
- sort
- 排序
- Whether posts should be sorted in chronological or reverse
- 帖子应按时间顺序排列还是反向排列
chronological order.
按时间顺序。
Possible values:
可能的值: p>
- ‘DESC’ reverse chronological order (default)
- “ DESC”按时间倒序(默认) li>
- ‘ASC’ chronological order
- “ ASC”的时间顺序 li>
ul>
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>
expandYears
expandYears p>
- 1 (true): Years collapse and expand to show months (default)
- 1(正确):年折叠并扩展以显示月份(默认) li>
- 0 (false): Only links to yearly archives are shown
- 0(否):仅显示年度存档的链接 li>
ul>
li>
- expandMonths
- expandMonths
- 1 (true): Months collapse and expand to show posts (default)
- 1(true):月折叠并展开以显示帖子(默认) li>
- 0 (false): Only links to yearly and monthly archives are shown
- 0(假):仅显示年度和每月存档的链接 li>
ul>
li>
- expandCurrentMonth
- expandCurrentMonth
- When true, the current month will be expanded by default
- 为true时,默认情况下会扩展当前月份 li>
ul>
li>
- expandCurrentYear
- expandCurrentYear
- When true, the current year will be expanded by default
- 为true时,默认情况下将扩展当前年份 li>
ul>
li>
- showPostTitle
- showPostTitle
- 1 (true): The title of each post is shown (default)
- 1(true):显示每个帖子的标题(默认) li>
ul>
li>
- showPostDate
- showPostDate
- 1 (true): Show the date of each post
- 1(true):显示每个帖子的日期 li>
ul>
li>
- postDateFormat
- postDateFormat
- The format in which the date should be shown (default: ‘m/d’)
- 日期显示的格式(默认值:“ m / d”) li>
ul>
li>
- postDateAppend
- postDateAppend
- after: The post date comes after the title (default)
- 之后:发布日期在标题之后(默认) li>
- before: The post date comes before the title
- 之前:发布日期早于标题 li>
ul>
li>
- postTitleLength
- postTitleLength
- Truncate post titles to this number of characters (default: 0 = don’t
- 将帖子标题截断为此字符数(默认值:0 =否
truncate)
截断) li>
ul>
li>
- post_type
- post_type
li>
- accordion
- 手风琴
li>
- number
- 号码
li>
- debug
- 调试
li>
ul>
Examples
示例 h4>
collapsArch('accordion=1&sort=ASC&expand=3&inExcludeCat=exclude&inExcludeCats=general,uncategorized') collapsArch('accordion = 1&sort = ASC&expand = 3&inExcludeCat = exclude&inExcludeCats = general,uncategorized')
code> pre>
This will produce a list with:
这将产生带有以下内容的列表:
* accordion style expanding and collapsing
*手风琴样式的扩展和折叠
* shown in chronological order
*按时间顺序显示
* using images to mark collapsing and expanding
*使用图像标记折叠和展开
* exclude posts from the categories general and uncategorized
*从常规和未分类类别中排除帖子 p>
collapsArch('post_type=recipe') collapsArch('post_type = recipe')
code> pre>
This will produce a list with:
这将产生带有以下内容的列表:
* only posts of type ‘recipe’
*仅类型为“食谱”的帖子
* shown in chronological order
*按时间顺序显示
* using images to mark collapsing and expanding
*使用图像标记折叠和展开
* exclude posts from the categories general and uncategorized
*从常规和未分类类别中排除帖子 p>
CAVEAT
CAVEAT h3>
This plugin relies on Javascript, but does degrade
此插件依赖Javascript,但会降级
gracefully if it is not present/enabled to show all of the
如果不存在/未启用,则不能显示所有
archive links as usual.
照常存档链接。 p>