keep menu-higlighting on child pages (3 posts)

  1. quis
    Posted 9 years ago #

    Hi everybody,

    I`m a greenhorn with wordpress and having a problem with the dynamic menu-higlighting.

    Making it clear…

    …I have two static webpages and assigned to each child pages.

    1. parent page
    1.1 first child page
    1.2 second child page

    2. parent page
    2.1 first child page
    2.2 second child page

    A menu in the header.php shall be generated for the parent pages, another in the appropriate sidebars -1 and -2 for the child pages.
    I found a solution within header through function”wp_list_pages” and parameter “depth=1” in the particular sidebars with “wp_list_pages” and “child_of=2”.

    There are classes (“current_page_item”) in the stylesheet for both types of menus, by which I highlight the active resp. selected menu item.

    So far so good, but here comes the problem…

    When I am on a child page I want the menu item of the parent page to keep its active status, resp. its class ”current_page_item” .

    In other words: what can I do to keep the menu item of the parent page highlightened on child pages?

    I hope someone can help me in any way…

    Greets, qUiS

  2. Zoutesnor
    Posted 9 years ago #

    Not sure if this will work, but you could try this in your link:
    <?php if($post->post_parent=1){?> class="current_page_item" <?php } ?>

  3. moshu
    Posted 9 years ago #

    The fold-pages plugin will let you do it.

Topic Closed

This topic has been closed to new replies.

About this Topic