Viewing 1 replies (of 1 total)
  • Hi @verticalpaleo,

    > Is there away to replace the actual search bar in the header by another one?

    Great question! You need 2 functions to do this and some custom CSS.

    //Remove the current Storefront Search
    add_action( 'init', 'marce_remove_storefront_header_search' );
    function marce_remove_storefront_header_search() {
    	remove_action( 'storefront_header', 'storefront_product_search', 	40 );
    }
    
    // Add a default WordPress Search
    add_action( 'storefront_header', 'marce_add_regular_wp_search', 40 );
    function marce_add_regular_wp_search() {
    	$searchform = get_search_form( false );
    	echo 	"<div class='site-search'>" . $searchform .  "</div>";
    }

    These functions will first remove the current search bar, and then add the default WordPress one wrapped in the right div element.

    CSS:

    .site-search form {
        position: absolute;
    }

    Cheers,

Viewing 1 replies (of 1 total)
  • The topic ‘How to replace the header search bar with another one?’ is closed to new replies.