How to get specific (grand parent) category of current post?
How to get specific (grand parent) category of current post?
How to get specific (grand parent) category of current post?
How can I order all subcategories alphabetical independent of the parent categories?
On your category template you can use get_queried_object() to get the current WP_Term object. From that you can check the parent property, which is 0, if it is a parent, or some integer, if it is a child term as it returns the parent term’s ID. $current_term = get_queried_object(); if ( $current_term->parent ) { // … Read more
As pointed out by Tom, this could end up being an expensive query, though from my anecdotal evidence from trying this on a rather large database (granted, only a handful of post types), I think you could write a decently sufficient query. If you’re using caching to store the categories, that could also alleviate some … Read more
If you are using Gutenberg Block Editor on WordPress, you can try the Gutentor plugin and use Advanced Post (Type) Block. You can check Advanced Post (Type) Block demo. You can Filter the Post by Category ( any post type with their taxonomy terms) and also add other options like pagination, navigation and load more … Read more
Allow Custom Role to edit a custom post type category
WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
Went about it a different way, works OK. Just in case anyone else is looking for similar functionality; //* dropdown add_filter( ‘woocommerce_product_categories_widget_dropdown_args’, ‘woo_product_cat_widget_args’ ); //* list add_filter( ‘woocommerce_product_categories_widget_args’, ‘woo_product_cat_widget_args’ ); function woo_product_cat_widget_args( $cat_args ) { if ( is_product_category( ‘experiences’ ) || term_is_ancestor_of( 2921, get_queried_object_id(), ‘product_cat’ ) ) { $cat_args[‘exclude’] = array(2548, 2245, 2775, 2913, 2846); … Read more
Custom sidebar isn’t showing up on sub-category posts
Hopefully your syntax was correct when you placed order and orderby. In thoery, your code should work with the following wp_dropdown_categories( array( ‘show_option_none’ => $cat_text, ‘option_none_value’ => ”, ‘taxonomy’ => rtcl()->category, ‘name’ => ‘rtcl_category’, ‘id’ => ‘rtcl-category-search-‘ . wp_rand(), ‘class’ => ‘form-control rtcl-category-search’, ‘selected’ => get_query_var( ‘rtcl_category’ ), ‘hierarchical’ => true, ‘value_field’ => ‘slug’, ‘depth’ … Read more