country
-
Hi,
I am a new user of this plugin and was wondering if its possible to shorten the list with
country names new users can choose from ie just 2 or 3 countries ?Or is it possible for me “admin” to choose my 2 or 3 default countries which would be on top of the list with country names ?
-
Hi @fimo66,
If you can make it a bit clear then I will be able to help you. Let me know if you want only 2 or 3 countries in the list or you want all other countries with 2 or 3 countries on the top of the list. Also, let me know the names of those countries which you want to use.
Do let me know and I will get back to you.Regards!
Hi again,
Thanks for the reply,help,
I would like 2 countries in my list:
Danmark
Sverige
Is that possible ?
thank you for your help…I prefer that it only shows those 2 countries if that is possible if not perhaps its possible to have those 2 on top of the list with all the countries ?
Hi @fimo66,
Apologies for getting back to you late. Please copy the code below and paste it in your active theme functions.php file at the bottom of the file. It will then show the specific country in the country field.
Here is the code//Display a specific country in the dropdown of country******** add_filter( 'user_registration_countries_list', 'display_specific_only' ); function display_specific_only( $country_list ) { $country_list = array( 'SE' => __( 'Sweden', 'user-registration' ), 'DK' => __( 'Denmark', 'user-registration' ) ); return $country_list; }Let me know if there are any issues.
Regards!
-
This reply was modified 6 years, 4 months ago by
Marius L. J.. Reason: Added code tags for readability
Hi again,
Thanks for the answer. the code, im using theme “twentysixteen” and tried to copy,paste
the above code into my themes functions.php , refresed the cache but i still see all of the countries in the drop down menu, perhaps i am missing something, im doing something wrong ?Thanks for the answer i have made a request to the support team now and hopefully they can help me futher to what im doing wrong with this above code
-
This reply was modified 6 years, 5 months ago by
fimo66.
Just for info, i got the correct code here and a great support from your team,
thank you for this plugin, support//Display a specific country in the dropdown of country******** add_filter( 'user_registration_countries_list', 'display_specific_only' ); function display_specific_only( $country_list ) { $country_list = array( '' => '--Select--', 'SE' => __( 'Sweden', 'user-registration' ), 'DK' => __( 'Denmark', 'user-registration' ) ); return $country_list; }-
This reply was modified 6 years, 4 months ago by
Marius L. J.. Reason: Added code tags for readability
-
This reply was modified 6 years, 4 months ago by
The topic ‘country’ is closed to new replies.