Forums › Forums › Search & Filter Pro › Multiple Categories (combination)
Tagged: custom fields, hierarchical, hierarchy, lecture, multiple categories, Taxonomies, taxonomy
- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by Trevor.
-
Anonymous(Private) August 21, 2016 at 6:43 pm #55163
Hi,
I’m trying to create a filter for portfolio pages with multiple categories.
So a portfolio page has 3 categories.
I’m trying to create a drop-down list for each category where the result is displayed based on the 3 choices in the dropdown menu’s. I use the auto update feature to show the count behind the categories.
However when I have 3 dropdowns (3 times a category) the other categories reset after making a selection in 1 category.
It seems you can only combine portfolio-category and portfolio-attribute, but I need one more option.
So this doesn’t work:
– portfolio-category
– portfolio-category
– portfolio-categoryor this
portfolio-category
portfolio-attribute
portfolio-attribute(in my backend these are called ‘project-categories’ and ‘project-attributes’)
Trevor(Private) August 21, 2016 at 7:07 pm #55166Hi Jonas
I have some general advice I give that might be worth repeating here, so please bear with me as I go into ‘old boring teacher mode’.
With regard to Search & Filter, you must not put the same field more than once on a form. The desire to do this is often because a taxonomy needs to be split into more than one.
WordPress is a blogging platform at heart. If you are NOT genuinely going to use it as a blog, then disable blogging. Almost every site I now make I do this. It is a GOOD and LIBERATING thing to do. Now WordPress is more like a CMS.
DO make Custom Post Types for your site. If your theme has support to make CPTs, all well and good. Otherwise, I always use the Custom Post Types UI plugin. The all-purpose theme that I use already has its own CPT and taxonomy functions, but where I don’t use that theme (rarely, as it is so flexible), I use this plugin. When making the CPT, think CAREFULLY about what standard WordPress meta types you actually want (excerpt, trackbacks, comments, author, etc).
DON’T use the core Category and Tags taxonomies. They are not descriptive enough for SEO, are aimed at blogs (which by now you have disabled) and not specific enough (taxonomies should really be specific to one CPT). DO make taxonomies specific to your individual CPT needs, named appropriately for SEO purposes.
DON’T use hierarchies in Taxonomies (parent -> child). Use Multiple taxonomies instead. For example, a single, hierarchical Location taxonomy might become two taxonomies of Countries and Cities.
DON’T use the core WordPress custom fields meta options (where you can add your own custom fields). Instead DO install a custom fields plugin, like Advanced Custom Fields (or even the Pro version). That flexible theme that I use already comes bundled with ACF Pro, so that’s a bonus for me! Use these fields for data relating to a CPT. BTW, handy hint, DO give the field group a name that lets a third party like me see immediately/easily which CPT it belongs to.
THEN … in S&F, in the form setup, enable Auto Count, and in each form field hide empty values. It should then do what you want (filter one control based on the selection made in another control).
Sad, boring lecture over. LOL
-
AuthorPosts