Make WordPress Core

Changeset 4576


Ignore:
Timestamp:
12/01/2006 12:05:21 PM (20 years ago)
Author:
ryan
Message:

Give CSS class to parent of current page/cat. Props mdawaffe. fixes #3253

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r4564 r4576  
    504504
    505505                $css_class = 'page_item';
     506                $_current_page = get_page( $current_page );
    506507                if ( $page->ID == $current_page )
    507508                        $css_class .= ' current_page_item';
     509                elseif ( $_current_page && $page->ID == $_current_page->post_parent )
     510                        $css_class .= ' current_page_parent';
    508511
    509512                $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . wp_specialchars($page->post_title, 1) . '">' . $page->post_title . '</a>';
    … …  
    613616                        $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
    614617                }
    615        
     618
     619                $_current_category = get_category( $current_category );
     620
    616621                if ( 'list' == $args['style'] ) {
    617622                        $output .= "\t<li";
    618623                        if ( ($category->cat_ID == $current_category) && is_category() )
    619624                                $output .=  ' class="current-cat"';
     625                        elseif ( ($category->cat_ID == $_current_category->category_parent) && is_category() )
     626                                $output .=  ' class="current-cat-parent"';
    620627                        $output .= ">$link\n";
    621628                } else {
Note: See TracChangeset for help on using the changeset viewer.