When using get_categories or similar, is it possible to filter results that contain certain Tags as well?

Check out my answer on how to get terms that are associated with others through the posts that they’re attached to. In your case, you could put it into practice like so; $category_IDs = get_terms_soft_associated( ‘category’, array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => ‘audio’ ) ); wp_list_categories( array( ‘include’ => $category_IDs ) ); … Read more

Show children of top level category only

Ok, try this. It should capture the current category object and then go up the chain until it finds the current categories top-most ancestor. // get the category object for the current category $thisCat = get_category( get_query_var( ‘cat’ ) ); // if not top-level, track it up the chain to find its ancestor while ( … Read more

Category Archive, list subcategories of each post

If you want to list only child categories of the current category, set the child_of argument to the current category ID. wp_list_categories( array( ‘child_of’ => get_queried_object_id(), // this will be ID of current category in a category archive ‘style’ => ‘none’, ‘title_li’ => ” ) ); EDIT- To list only child categories per-post of the … Read more

WordPress: category page not for post’s

Add the ‘post_type’ parameter in your query args (‘post_type’ => ‘game’): <?php if (is_page() ) { $category = get_post_meta($posts[0]->ID, ‘category’, true); } if ($category) { $cat = get_cat_ID($category); $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $post_per_page = 4; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( ‘post_type’ => ‘game’, … Read more

How to create 450 categories in wp

You can try using BulkPress. It allows you to create hundreds of categories very easily. Follow these steps: Install and activate the plugin. In the left side bar, hover your cursor on Bulkpress. Then click on Terms. A new page will appear. In Taxonomy field, choose Category. Insert your Categories in the Terms field. Choose … Read more

Alphabetically ordered category list

Found the solution. Simply add $args = array( ‘parent’ => ‘0’, ); at the top, and change $cats = get_terms(‘category’); to $cats = get_terms(‘category’, $args); There are more values, see https://codex.wordpress.org/Function_Reference/get_terms