What’s the difference between “parent” and “category_parent” in a WP_Term object?

The properties prefixed with category_ or cat_ are there for backwards compatibility. Taxonomies and terms were introduced in WordPress 2.3 (11 years ago) and categories were converted into a taxonomy at that time. Prior to this categories had their own properties (the ones with the aforementioned prefixes). For backwards compatibility, the _make_cat_compat() function is used … Read more

WordPress REST get all items without a taxonomy assigned

I was able to solve the problem by adding a custom route. Although i had to do the same process in php by first querying all available terms of the type and then exclude them from the query. $available_terms = array_map( function ( $term ) { return $term->term_id; }, get_terms( ‘lagerboxen_kategorie’ ) ); return get_posts( … Read more

Paginate_links won’t create the right links on a taxonomy filtered custom post type archive

If, for example, I click on the “2”, the page loaded as removed my taxonomy filter(s) and paginate navigation “max-page” looks like (seems to be) the number of pages non filtered by taxonomy It’s not that the (taxonomy) filters are removed from the pagination links, but instead, the filters are actually never added because the … Read more

Archive pages for posts based on their taxonomy?

The Template Hierarchy Codex entry is your friend. Archive page for category hair: category-hair.php Archive page for taxonomy shampoo: taxonomy-shampoo.php Archive page for taxonomy shampoo term dry: taxonomy-shampoo-dry.php To display some cross-query between different taxonomies, such as category and a custom taxonomy, such as hair, you’ll need to do a custom query, and display it … Read more

Conditional tag affecting taxonomy term and its children?

I have a handy little function that i based on post_is_in_descendant_category function it expends the is_tax to check if its the term or any of his children function is_or_descendant_tax( $terms,$taxonomy){ if (is_tax($taxonomy, $terms)){ return true; } foreach ( (array) $terms as $term ) { // get_term_children() accepts integer ID only $descendants = get_term_children( (int) $term, … Read more

Getting 404 on taxonomy page

I’ve solved this for myself with rewrite rule. The story: I have “piece” custom post type, taxonomy “media_tag” with “m_audio” term and taxonomy “genre_tag” with “g_sacred”, “g_folk” etc. And I want to have an URL like /piece/audio/<genre> to access archives. So, now I have in my functions.php: add_filter( ‘rewrite_rules_array’, ‘my_insert_rewrite_rules’ ); function my_insert_rewrite_rules( $rules ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)