[Resolved] Enable Search on Secondary Navigation

Home Forums Support [Resolved] Enable Search on Secondary Navigation

Home Forums Support Enable Search on Secondary Navigation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #632601
    Rick

    I am designing a site where I use either the Primary Navigation or the Secondary Navigation depending on the page. I would like to have search enabled for both, but GP only enables search for the Primary Navigation. Is there a code snippet somewhere that I can use for this feature?

    Thanks!
    -Rick

    #632876
    Tom
    Lead Developer
    Lead Developer

    Hey Rick,

    It’s not really built to work in two different places at once, but if it’s possible, you’d use this function: https://docs.generatepress.com/article/navigation-search/#use-navigation-search-in-secondary-navigation

    However, you’d need to remove these lines:

    remove_action( 'generate_inside_navigation', 'generate_navigation_search' );
    remove_action( 'generate_inside_navigation', 'generate_mobile_menu_search_icon' );
    remove_filter( 'wp_nav_menu_items', 'generate_menu_search_icon', 10, 2 );
    #633079
    Rick

    Thanks Tom! I appreciate the quick response!

    #633277
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.