Use wp_list_categories() in templates.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f34731ff30
commit
49e390d402
|
@ -3,13 +3,9 @@
|
|||
<div id="menu">
|
||||
|
||||
<ul>
|
||||
<?php wp_list_pages(); ?>
|
||||
<?php wp_list_bookmarks(); ?>
|
||||
<li id="categories"><?php _e('Categories:'); ?>
|
||||
<ul>
|
||||
<?php wp_list_cats(); ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php wp_list_pages('title_li=' . __('Pages:')); ?>
|
||||
<?php wp_list_bookmarks('title_after=&title_before='); ?>
|
||||
<?php wp_list_categories('title_li=' . __('Categories:')); ?>
|
||||
<li id="search">
|
||||
<label for="s"><?php _e('Search:'); ?></label>
|
||||
<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
|
|
|
@ -46,11 +46,7 @@
|
|||
</ul>
|
||||
</li>
|
||||
|
||||
<li><h2>Categories</h2>
|
||||
<ul>
|
||||
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&title_li=<h2>Categories</h2>'); ?>
|
||||
|
||||
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
|
||||
<?php wp_list_bookmarks(); ?>
|
||||
|
|
|
@ -212,11 +212,11 @@ function wp_list_categories($args = '') {
|
|||
else
|
||||
parse_str($args, $r);
|
||||
|
||||
$defaults = array('show_option_all' => '', 'orderby' => 'ID',
|
||||
'order' => 'asc', 'style' => 'list', 'show_last_update' => 0,
|
||||
$defaults = array('show_option_all' => '', 'orderby' => 'name',
|
||||
'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list',
|
||||
'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1,
|
||||
'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '',
|
||||
'hierarchical' => true, 'title_li' => '');
|
||||
'hierarchical' => true, 'title_li' => __('Categories'));
|
||||
$r = array_merge($defaults, $r);
|
||||
$r['include_last_update_time'] = $r['show_date'];
|
||||
extract($r);
|
||||
|
@ -224,7 +224,7 @@ function wp_list_categories($args = '') {
|
|||
$categories = get_categories($r);
|
||||
|
||||
$output = '';
|
||||
if ( $title_li && $list )
|
||||
if ( $title_li && 'list' == $style )
|
||||
$output = '<li class="categories">' . $r['title_li'] . '<ul>';
|
||||
|
||||
if ( empty($categories) ) {
|
||||
|
@ -243,7 +243,7 @@ function wp_list_categories($args = '') {
|
|||
$output .= walk_category_tree($categories, $depth, $r);
|
||||
}
|
||||
|
||||
if ( $title_li && $list )
|
||||
if ( $title_li && 'list' == $style )
|
||||
$output .= '</ul></li>';
|
||||
|
||||
echo apply_filters('list_cats', $output);
|
||||
|
|
|
@ -430,6 +430,7 @@ function wp_list_cats($args = '') {
|
|||
$r['show_count'] = $r['optioncount'];
|
||||
if ( !empty($r['list']) )
|
||||
$r['style'] = 'break';
|
||||
$r['title_li'] = '';
|
||||
|
||||
return wp_list_categories($r);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue