- This topic has 3 replies, 3 voices, and was last updated 4 years, 1 month ago by
Support Team.
- AuthorPosts
- April 15, 2019 at 8:32 am #13678
max
ParticipantHi,
How to remove other country that i dont want to display.
April 16, 2019 at 6:28 am #13732wensolutions
KeymasterHello,
Actually we are not quite clear about which sections country listing you want the customization. However, to customize the country list please add the below given code in your child theme’s function.php file.
Please refer to the given link to know more about child theme :https://wptravel.io/how-to-create-a-child-theme/
Code snippet if you want to remove the country from existing country list (case to remove Afghanistan from the list ) :
function customize_toremove_countries( $countries ) { unset( $countries['AF'] ); return $countries; } add_filter( 'wp_travel_country_list', 'customize_toremove_countries' );
Code snippet if you want to create a new country list that overrides existing country list (case to make the country list with only Nepal on the list) :
function customize_tolimit_countries ( $countries ) { $c = array ( 'NP' => __('Nepal' , 'wp-travel') ); return $c; } add_filter( 'wp_travel_country_list' , 'customize_tolimit_countries');
Hope this clears your confusion,
Feel free to reach us for any further query/confusion,
Regards!!
April 16, 2019 at 7:25 am #13735max
ParticipantHi sir,
It’s ok and keep it for future use because i just set default is Malaysia country.
Thank
April 17, 2019 at 6:10 am #13767Support Team
Keymaster - AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.