Hi, I am creating a custom field, type "Checkboxes", slug "country-of-origin". There are 199 countries in my excel file list.
1. I have read that I can import this list into a custom field using an importer. Or I can also create a database and link it to the custom field.
Which of the options is better? I want to reuse the list in other custom fields as well. Can you please show me step by step of how to do so?
2. I am using the content template to show the custom field. How do I show the value of the multiple checkboxes if it is imported from a database (option 2 above)?
I have manually created the 199 checkboxes custom fields before. But to create another custom field with the same 199 countries, it is a lot of work. Sometimes I can not add any checkboxes anymore for unknown reasons.
Hello,
I don't think it is a good idear to setup a custom checkboxes field with 199 options, it will conduct other unexpected result.
I suggest you try with custom hierarchical taxonomy, see our document:
https://toolset.com/documentation/user-guides/custom-content/create-custom-taxonomies/
Hierarchical taxonomy works just like post categories. It appears as a tree and you have checkboxes to select taxonomy terms.
See screenshot:
https://toolset.com/wp-content/uploads/2011/10/categories.jpg
The taxonomy is WordPress built-in feature, with it, you can manage the taxonomy terms easily, and filter the result by taxonomy:
https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/
Group the posts by taxonomy terms:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/
For example, you can create a hierarchical taxonomy "Country", the taxonomy slug is "country", and use custom codes to import the taxonomy data, see similar post here:
https://wordpress.stackexchange.com/questions/26420/fast-way-to-add-countries-as-a-custom-taxonomy-term