Navigation Search

This feature has been replaced with the Navigation Search Modal feature introduced in GeneratePress 3.3.0

The Navigation Search option can be found in Appearance > Customize > Layout > Primary Navigation.

This option adds a search icon (magnifying glass) to your navigation bar. When you click it, a semi-transparent search bar covers your menu items and allows you to enter a term to search your site.

Use Navigation Search in Secondary Navigation

By default the navigation search is located in primary navigation, the snippet below allows you to move it to the secondary navigation.

Please note that the navigation search option should be activated under Layout > Primary Navigation in order for the snippet to work:

add_action( 'wp', function() {
    if ( 'enable' === generate_get_option( 'nav_search' ) ) {
        remove_action( 'generate_menu_bar_items', 'generate_do_navigation_search_button' );
        add_action( 'generate_secondary_menu_bar_items', 'generate_do_navigation_search_button' );

        remove_action( 'generate_inside_navigation', 'generate_navigation_search' );
        add_action( 'generate_inside_secondary_navigation', 'generate_navigation_search' );
}, 20 );

Learn how to add PHP here.