How to add yith woocommerce search bar to the header?


How to add YITH WooCommerce Ajax Search or WooCommerce Predictive Search bar in travelify theme header.

I have tried many things like tweaking functions.php, but its not working. Please some body help me with this issue.

The basic idea to add default Wordpress search bar in header is like this.

In your case you need to output a shortcode that these plugins offer to output them inside template files. Here is an example:

// Custom WooCommerce Ajax Powered search in header via Child Theme functions.php
add_action( 'travelify_header', 'travelify_child_custom_search' , 5 );

function travelify_child_custom_search() {
	echo do_shortcode( '[shortcode_that_these_plugins_offer]' );

I am not familiar with these plugins but they should come with some shortcodes that you can use within template files. Use those and replace shortcode name in my above given example.

Let me know if this helps.