If you are willing to add more filter options to the search filters available on the theme homepage, then worry not WP Travel plugin provides the feature regarding adding more filter options using a filter code.

You might be interested: How To Add Custom Filters Using WP Travel Pro?

Steps to add more filter options to the search filters

Step 1: Add the given code in the functions.php file

To add the Trip Type filter and the Keyword filter, please add the following given code in the functions.php file of your child theme.

add_filter( 'wp_travel_search_filter_input_fields', 'prefix_wp_travel_search_filter_input_fields' );
function prefix_wp_travel_search_filter_input_fields(){
	$filter_search = array(
		'search'          => true,
		'trip_type'       => true,
	        'location'        => true,
		'activity'        => true,
	        'travel_keywords' => true,
	);
	return $filter_search;
}

For detailed information on creating a child theme, please refer to our Knowledgebase.

Step 2: Show the filter option using the filter code

You can show the filter option according to your choice using the filter code.

For example, let’s show the Keywords filter and Trip Type filter please add the following given code in the functions.php file of your child theme.

add_filter( 'wp_travel_search_filter_input_fields', 'prefix_wp_travel_search_filter_input_fields' );
function prefix_wp_travel_search_filter_input_fields(){
	$filter_search = array(
		'search'          => false,
		'trip_type'       => true,
	        'location'        => false,
		'activity'        => false,
	        'travel_keywords' => true,
	);
	return $filter_search;
}

Output

Also, if you want to learn more about the filter hook that is available in the WP Travel plugin, please refer specific hook page

Conclusion

If you liked this article, then subscribing to our YouTube Channel for WordPress video tutorials would be the cherry on top.

You can also find us on Facebook, Instagram, Linkedin, TikTok, Pinterest, Reddit, and our dedicated engaging Facebook user community,

Further, if you have any queries, please submit them to our Contact page.

Get WP Travel Pro and start creating your travel and tour booking website within minutes without any hassle of coding.