Add cat-item-id and page-item-id classes. Props Otto42. fixes #4703

git-svn-id: http://svn.automattic.com/wordpress/trunk@5920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-22 22:59:45 +00:00
parent f65528ed41
commit 276b690c7e
1 changed files with 8 additions and 6 deletions

View File

@ -511,10 +511,10 @@ class Walker_Page extends Walker {
if ( $depth )
$indent = str_repeat("\t", $depth);
extract($args, EXTR_SKIP);
$css_class = 'page_item';
$css_class = 'page_item page-item-'.$page->ID;
$_current_page = get_page( $current_page );
if ( $page->ID == $current_page )
$css_class .= ' current_page_item';
$css_class .= ' current_page_item ';
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
$css_class .= ' current_page_parent';
@ -634,10 +634,12 @@ class Walker_Category extends Walker {
if ( 'list' == $args['style'] ) {
$output .= "\t<li";
$class = 'cat-item cat-item-'.$category->term_id;
if ( $current_category && ($category->term_id == $current_category) )
$output .= ' class="current-cat"';
$class .= ' current-cat';
elseif ( $_current_category && ($category->term_id == $_current_category->parent) )
$output .= ' class="current-cat-parent"';
$class .= ' current-cat-parent';
$output .= ' class="'.$class.'"';
$output .= ">$link\n";
} else {
$output .= "\t$link<br />\n";