[resolved] Highlight current page in List of childpages (3 posts)

  1. rezer5
    Posted 3 years ago #

    Hello, i found a codesnippet which was the one i was looking for. It lists the childpages of the current motherpage.

    <?php if ( is_page() ) { ?>
    $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'); else
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    <?php echo $children; ?>
    <?php } } ?>

    But one thing is missing. It doesnt highlights the current page. Can anybody help me to resolve the problem?!? I've tried to fix it, but i dont know how :-( .

    Greetings rezer

  2. Michael
    Part-Time Forum Moderator
    Posted 3 years ago #

    please post a link to your site, to the page with the problem.

    generally, 'wp_list_pages()' does output the css class .current_page_item for the current page: http://codex.wordpress.org/Function_Reference/wp_list_pages#Menu_Item_CSS_Classes

  3. rezer5
    Posted 3 years ago #

    haha, ok i found it!! That was more easy than i thought :-)

    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Topic