Template taxonomy-{taxonomy}.php doesn’t show my posts

Well, first of all, you are not doing anything with the $term variable. You are querying it, but then it sits there, waiting to be picked up. Try this code in your taxonomy template, called taxonomy-hardware_category.php: // prepare the variables for the query $tax = get_query_var(‘taxonomy’); $term = get_query_var(‘term’); // Setup the loop, build the … Read more

Why is my archive page looping through all but one post?

As @Jacob Peattie says, pagination is what’s causing this, and probably what you want to add if you will have more posts over time. If you want you can disable pagination for archive pages easily with this in your functions.php: function wpse_disable_pagination( $query ) { if (is_archive()) { $query->set(‘nopaging’, 1 ); } } add_action( ‘pre_get_posts’, … Read more

How to overwrite the category template in a plugin

I noticed that you’re using is_category() in your function, which means you’re targetting the default/core category taxonomy and not a custom taxonomy, hence you should instead use the category_template hook. E.g. add_filter( ‘category_template’, ‘load_new_custom_tax_template’); function load_new_custom_tax_template ($tax_template) { // I don’t check for is_category() because we’re using the category_template filter. return dirname( __FILE__ ) . … Read more