You should only need one template. What you’re describing is how things should work, if your templates are written correctly.
In your case you only need taxonomy-kernal_category.php
. This template will be used for all terms automatically, and the correct posts will be displayed as long as you use the standard loop:
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
// Display post content
endwhile;
endif;
?>
So there should be no manual querying of posts with WP_Query
or anything like that.
To output the name of the current term dynamically, you can use the_archive_title()
, and the description with the_archive_description()
.
the_archive_title()
often prefixes the title with the taxonomy name, like “Kernal Category: News”, so if you don’t want that yuo can use single_term_title();
.
Related Posts:
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Check if current term is a child of another term
- How to hide custom taxonomy archives same way as hiding custom post types?
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Page queried instead of a custom taxonomy
- Using a different template per Custom Taxonomies for single term archive pages
- Creating an Archive using a Custom Taxonomy
- Display direct children of the current custom taxonomy in taxonomy.php template
- Date archive permalinks for custom taxonomy
- Taxonomy archive showing no results
- List taxonomies according to whether this post is in another taxonomy in taxonomy archive
- orderby meta_value breaks taxonomy term archives
- Why is the custom taxonomy archive page redirecting me to a single post? [closed]
- How to have two different versions of a tag/category/taxonomy archive page?
- Automatically Give All Custom Post Types a Pre-Set Category [duplicate]
- How to add Post Format Taxonomy Archive page in the menu?
- How does WordPress Parent-Child Taxonomy actually Works?
- Custom taxonomy archive shows 404 error
- Custom Taxonomy index/archive hierarchy
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- How to use multiple archive templates for a taxonomy?
- how does the wordpress rest API work
- Taxonomy archive template that shows posts from more than one taxonomy
- Custom Taxonomy List with Children
- why the archive of custom taxonomy term shows nothing?
- Can I output a custom taxonomy as a submenu in the site navigation menu?
- Add terms to a taxonomy archive from within the same taxonomy
- Custom Taxonomies Archive Page 404
- How to create archive pages for metadata query generated posts (so without taxonomy)?
- How to create a completely functioning separate archive for posts from only 1 or 2 specific categories
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- How to get a terms and posts associated with another term?
- Change the Page Title of the Archive Page for Portfolio Tags
- Custom taxonomy return 404
- What’s the url queryvar for a taxnomy archive?
- Multi level archive
- Custom Taxonomy Archives Page Errors
- index.php Not Showing Custom Posts / Terms
- Custom Taxonomy Archive Page for Parents AND Children?
- Redirect or Prevent Viewing of Custom Taxonomy’s Archives?
- Creating a Taxonomy Page [duplicate]
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- Insert code on specific taxonomy archives
- Permalinks not working on MU network with domain mapping
- Custom Taxonomy Archive URL rewrite
- Can you orderby slug in a taxonomy archive page using WP_Query?
- More than one Hierarchical Taxonomy and SEO
- Getting Catategory / Taxonomy Description on Non-archive Pages
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- Custom taxonomy archive empty
- Why my archive title isn’t showing?
- Creating a custom archive page for WooCommerce products based on tags
- Display category posts grouped by taxonomy
- get_query_var(‘paged’) always returns empty
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- Taxonomy query for children of parents
- how to get title to custom tags page
- Display sub-taxonomies based on SELECTED parent-taxonomy
- How to redirect custom post type archive to first term of associated taxonomy?
- Refresh Taxonomies
- Get Bottom Most Level Taxonomy Terms?
- Displaying custom taxonomy terms active trail
- List Recent Post Titles from Custom Taxonomies?
- Get posts from taxonomy URL
- How can I hide admin columns showing extra custom taxonomy fields?
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- How to separate posts in loop?
- Custom Taxonomy isn’t working from frontend post submitting
- Base permalink for custom taxonomy
- Custom post type / taxonomy rewrite archive page 2 gives 404
- put custom taxonomy slug in front of their respective term slugs
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- Problem with removing post tags programmatically
- Query custom taxonomy by term id?
- {$taxonomy}_edit_form_fields not working
- Custom taxonomy link automatically removing query string and re-directing
- Custom taxonomy filter for media
- export and import taxonomy terms from one taxonomy to another
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Find terms in a custom taxonomy based on the hirearchy
- WooCommerce custom taxonomy as meta?
- Query custom taxonomy for category including children
- Get 1st parent category id from post
- Filter by Custom Taxonomy AND Custom Field
- Display custom taxanomy on woocommere product page
- when custom taxonomy is empty, the page won’t load
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- register_taxonomy_for_object_type (images) : how to use it ?
- Restrict user to terms in a custom taxonomy registered for both posts and users
- WordPress search form and search result through ACF field in custom taxonomy
- WordPress tag or archive php file customization
- Dynamic value for get_option linked to taxonomy term_id?
- If page is a taxonomy do X, if is a term, do Y
- Custom taxonomy list in two columns
- get multiple values from $_GET from multiple checkboxes
- Using wp_query is it possible to orderby taxonomy?
- Way to organize content – custom taxonomies or other way?