[Resolved] Updated code for Navigation Search in Secondary Navigation

Home Forums Support [Resolved] Updated code for Navigation Search in Secondary Navigation

Home Forums Support Updated code for Navigation Search in Secondary Navigation

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1016276
    Natalie

    Now that you can use SVG as the icon for search, I think the code in Use Navigation Search in Secondary Navigation
    needs an update.

    I have used

        if ( $args->theme_location == 'secondary' ) {
    			$icon = generate_get_svg_icon( 'search', true );
    			return $nav . '<li class="search-item" title="' . esc_attr_x( 'Search', 'submit button', 'generatepress' ) . '"><a href="#">' . $icon . '<span class="screen-reader-text">' . _x( 'Search', 'submit button', 'generatepress' ) . '</span></a></li>';
        }

    instead of the original

    	if ( $args->theme_location == 'secondary' ) {
    		return $nav . '<li class="search-item" title="' . esc_attr_x( 'Search', 'submit button', 'generatepress' ) . '"><a href="#"><span class="screen-reader-text">' . _x( 'Search', 'submit button', 'generatepress' ) . '</span></a></li>';
    	}

    Note that the code is also referenced here:

    https://gist.github.com/generatepress/38a3d4d0e3f1be118cac76937e4c92e6#file-gistfile1-txt

    #1016911
    Tom
    Lead Developer
    Lead Developer

    Thanks for the heads up! Updated 🙂

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