Show all post for a given category

You can use the WordPress Template Hierarchy. Copy your category.php file and rename it. category-{slug}.php – If the category’s slug is news, WordPress will look for category-news.php. category-{id}.php – If the category’s ID is 6, WordPress will look for category-6.php. category.php You can also use template_include to conditionally display a template add_filter( ‘template_include’, ‘category_page_template’, 99 … Read more

Order posts by taxonomy count

this topic might help you. By default args of WP_Query – this is impossible. I don’t think you can do that directly. Although you can save terms count for each post in a custom meta field (on post publish) and then in your query define sort by that meta field. Or while running your query, … Read more

Get ONLY the number of results in a query

There are three sides for the “efficiency” issue. From the DB side, most of the time is spent in traversing the DB tables. If you need all the rows, you need the DB to traverse all of them no matter what information will be returned. There is probably a cost associated with holding data in … Read more