Add $args to wp_list_categories

The documentation for the wp_list_categories filter says that it: Filters the HTML output of a taxonomy list. So it filters the final HTML, not the args, but you’re returning $args, which means that the final HTML is replaced with the args array. That’s why you’re seeing “Array”. To filter the args for the categories list … Read more

List of post categories only associated to another custom taxonomy

Here’s what I come up with, looks like it’s working. But maybe (surely) there’s a more efficient way to do the same: // current queried $term = ‘sector’; $current_sector_id = get_queried_object_id(); // Prepare wp_query to get all posts assigned to the current “sector” $sector_posts_query = new WP_Query(); $sector_posts_query->query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, … Read more

How to add tags under categories

I believe the core issue here is that tags aren’t organized by categories. As far as WordPress is concerned, tags and categories don’t have a direct relationship with each other. They are simply different ways of organizing posts, where the key difference is that categories are hierarchical (there are parent categories and subcategories) and tags … Read more

Filtering blog posts by category

Ok, with a bit more digging, it seems there are two things I can do: Use the Categories menu option, which will then make use of the archive.php template – nice and easy. Use the WP_Query() function to make a direct DB query for a particular category .. I think this is exactly what I … Read more