How can I check if a taxonomy has more than one item?

And if you want to check if current post has more than one term in given taxonomy (it’s not very clear in your question and this version makes much more sense for me…), then function get_the_terms will come handy: $terms = get_the_terms( $post, $taxonomy ); echo ( count($terms) > 1 ) ? ‘Destinations’ : ‘Destination’;

Custom taxonomy query not working with switch_to_blog

I find the solution: Tax_query not working on multisite (I dont say, that I work with switch_to_blog, because everything is works fine with this function… everything, including postmeta queries, category__not_in, etc., but EXCEPT: tax_query) So, “you have to register that custom taxonomy in both blogs”. <– so the problem originate from the different themes, when … Read more

get_terms showing all categories instead of the ones assigned to a specific post

There are two functions: get_terms get_terms( string|array $args = array(), array $deprecated = ” ) Which retrieves the terms in a given taxonomy or list of taxonomies. And… get_the_terms get_the_terms( int|object $post, string $taxonomy ) Which retrieves the terms of the taxonomy that are attached to the post. You should use second one in your … Read more

Adding Age Based WordPress Category

You might like to: Use a custom field as @Fayaz mentions above. Advanced Custom Fields will be the best for this (and you have it already). Add a new field (and I’d call it ‘Year of birth’) using Range. You could use a datepicker, but this way it’s cleaner and less intrusive: This will then … Read more