This plugin uses Javascript to dynamically expand or collapse the set of months for each year and posts for each month in the archive listing of your …
This is a relatively simple plugin that uses Javascript to make the Archive links in the sidebar collapsable by year and/or month. There are a number of options available, such as having the ability to link to the archive pages or not, and whether or not you want to display individual posts or not. It also supports custom post-types. There are several default styling options built-in which work well with most themes. You can also define your own custom styles.
I use this plugin in my blog at http://blog.robfelty.com
The easiest way to use this plugin is as a widget.
After you have installed the Collapsing Archives plugin, then simply go the Appearance > Widgets section in wp-admin and add the Collapsing Archives Widget to whatever sidebar or widget section you like, and then configure to your heart’s content.
It is also possible to use the plugin on any page you like with a little bit of PHP code. Simply change the following here appropriate (most likely sidebar.php):
Change From:
<ul> <?php wp_get_archives(); ?> </ul>
To something of the following:
<?php if( function_exists('collapsArch') ) { collapsArch(); } else { echo "<ul>\n"; wp_get_archives(); echo "</ul>\n"; } ?>
$defaults=array( 'noTitle' => '', 'inExcludeCat' => 'exclude', 'inExcludeCats' => '', 'inExcludeYear' => 'exclude', 'inExcludeYears' => '', 'sort' => 'DESC', 'showPages' => false, 'linkToArch' => true, 'showYearCount' => true, 'expandCurrentYear' => true, 'expandMonths' => true, 'expandYears' => true, 'expandCurrentMonth' => true, 'showMonthCount' => true, 'showPostTitle' => true, 'expand' => '0', 'showPostDate' => false, 'postDateFormat' => 'm/d', 'postDateAppenc' => 'after', 'accordion' => 0, 'postTitleLength' => '', 'post_type' => 'post', 'debug' => '0', );
customCollapse
expandYears
collapsArch('accordion=1&sort=ASC&expand=3&inExcludeCat=exclude&inExcludeCats=general,uncategorized')
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
collapsArch('post_type=recipe')
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
This plugin relies on Javascript, but does degrade
gracefully if it is not present/enabled to show all of the
archive links as usual.
The collapsing archives plugin uses several ids and classes which can be
styled with CSS. These can be changed from the settings page. You may have to
rename some of the id statements. For example, if your sidebar is called
“myawesomesidebar”, you would rewrite the line
to
If you are using the plugin manually (i.e. inserting code into your theme),
you may want to replace #sidebar with #collapsArchList
category name. How do I fix this? =
If your theme has some css that says something like
that is the problem.
You probably want to add a float:left to the .sym class