WordPress.org

Ready to get started?Download WordPress

Forums

Custom Menus on Different Pages problem (1 post)

  1. jrussev
    Member
    Posted 1 year ago #

    On my new WP project, I have custom menus on different pages. I have main menu (Appearance -> Menus) and the pages of this menu have their own custom menus. I use code from this theme:

    http://wordpress.org/support/topic/custom-menus-on-different-pages

    <?php wp_nav_menu( array( 'container' => 'none', 'container_class' => 'menu-header', 'theme_location' => 'primary', 'menu' => get_post_meta( $post->ID, 'MenuName', true) ) ); ?>

    Everything works fine with this code.
    When I chose some page from main menu, I know which is the current_page_item and can make proper styling. But when I chose some page from custom menu the main menu item is no longer with proper styling. How can I set current_page_item for main menu item, when I navigate through custom menu belonging to this main menu item ?

Topic Closed

This topic has been closed to new replies.

About this Topic