"Search" widget

Do you know, is there a way to add the search wodget to the header area or top navigation? Thanks

Hello there,

To accomplish it, add the below function to your child theme’s functions.php file.

    add_filter( 'wp_nav_menu_items', 'sydney_child_add_top_search_menu', 10, 2 );
    function sydney_child_add_top_search_menu( $items, $args ) {
        if ($args->theme_location == 'primary') {
            $items .= '<li class="top-search-menu">'.get_search_form(false).'</li>';
        }
        return $items;
    }

Or you can use a functionality plugin like Code Snippets if you aren’t running a child theme.

Regards,
Kharis

Thank you! This worked perfectly. I used Code Snippet and the code that you provided.

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis