• cheriejd

    (@cheriejd)


    I have a site that is using sub menus on some pages, but not on the sub pages.

    I would like to have the parent item in the menu always highlighted as current page, even if I am on a child page of that page.

    I am using the Andreas theme. This is the line in the functions.php that highlights the current page item
    <?php if (is_page()) { $highlight = “page_item”; } else {$highlight = “page_item current_page_item”; } ?>

    I thought it might be
    <?php if (is_page() | is_child()) { $highlight = “page_item”; } else {$highlight = “page_item current_page_item”; } ?>
    but that isn’t working.

    So, basically, in main menu which only shows parent pages, I would like the parent to remain in the current_page_item state if one of their children is showing.

    thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sub menu Parent highlighting’ is closed to new replies.