You can do it in many ways.
Two solutions I recommend are:
1. Editing category template
Just edit your category.php
template and put if statement in there:
if ( is_category( array(15, 19) ) )
get_template_part('category-15-19');
else
get_template_part('category-all')
Then just put code for category 15 and 19 into category-15-19.php
file and code for other categories into category-all.php
file.
2. Using template_include
hook
Add filter to template_include
hook. It should return template name that should be displayed by WordPress.
function my_categories_template($template_name) {
if ( is_category( array(15, 19) ) )
return 'category-15-19.php';
return $template_name;
}
add_filter( 'template_include', 'my_categories_template' );
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- WooCommerce: List All Categories
- Get rid of WordPress category, tag and author archives?
- Filtering categories in the permalink structure
- get_categories hierarchical order like wp_list_categories – with name, slug & link to edit cat
- Wrap Post count in a span
- wp_nav_menu not appearing for a couple pages
- Why aren’t sub-categories nested after creating post in the WP Admin?
- Preventing index.php?category_name=something from redirecting
- How to get category id of current post?
- Programmatically create product category and add thumbnail in woocommerce
- Trash bin for categories
- Categories’ hierarchy in URL
- Display one category in one page
- How to get next previous category in same taxonomy?
- Show Subcategory Description
- is_archive() content being shown instead of is_category()
- Check is category parent or not from its ID
- Which php file lists all the post of a category
- How to query posts from specific authors and categories using WP_query?
- Apply custom category template to subcategories
- Retrieve all posts within tag OR category?
- Include template before a loop
- How to customize tag and category post listings to show introductory content?
- List Terms in Category
- Can you have a single set of “canonical” categories shared by all blogs?
- List Posts by Category for a Non-Zero, Non-NULL Custom Field Value?
- Include posts from feature category in pre_get_posts
- Rename Default Category (Uncategorized) Via a Function
- How to customize category template?
- Customized landingpages for categories
- get_the_category_list open in parent window
- Show category images on single product page and product overview page
- Class active for Archive link – looped out
- Get parrent category name
- Display specific categories by ID
- Sorting category products not working
- Show category from “Next post” and “Previous post” [edited]
- Remove sub-menu item from admin menu
- Counter in loop in foreach
- How to add WordPress sub category without select
- Add child category to parent on post creation and save
- wp_list_categories in in nav_menu
- How to customize categories panel?
- How to use an array of categories as a dropdown?
- ACF add custom fields to categories and display
- Custom taxonomy template for categories
- Show category with link
- How to create a custom categories page
- Select posts from Category
- Display a list of subcategories a post belongs to
- Display unused categories in dropdown
- Get post related on category
- Give Children Unique ID’s
- Some of the category description not showing up in category page
- Searching for a category returns nothing if category is empty
- Need to echo category id in multi-dimensional array
- How to exclude posts from category posts count
- Use blog as base for tags and categories
- Exclude parent category when getting category posts by slug
- I would like to feature a tip on the homepage
- Redirect depending on category chosen
- Can’t iterate through 2 levels of categories
- Problem: retrieving parent category’s first post
- Category URL Management
- Update custom category fields front-end
- how can we bring category metabox to Media Library/Upload New Media Page
- How can I display a list of categories of my posts
- 404 on category URL
- Include last post date in get_categories loop
- Problem creating wp categories
- List of post categories only associated to another custom taxonomy
- Add Post Categories in Post Tags Field Programmatically
- How do I remove “Uncategorized” from my theme on my posts page?
- List all categories and count number of posts within based on custom date
- Category URL’s 404 after setting category base to ‘.’
- sort post category listing
- Display all posts from specific category
- How to apply wordpress ‘with_front’ = false for categories?
- Custom Category Archive Pages
- Filter custom taxonomy posts via AJAX
- set a parent category in a product woocommerce
- A search box for all sites – Multisite
- How to grab posts from the most recently created category
- Match two taxonomies to display a specific content
- How to get multiple loop in category.php, my scripts becomes madness
- Modify / Rewrite single template url structure
- Formating content in category.php
- How to use Greek characters/letters in a query?
- Make three menus with three category levels
- Getting categories to change appropriately when using $cat = ‘ ‘;
- how to call the category of the post
- Category related -> excerpt, title and thumb in sidebar on article page
- How to have a category not show up in query post with page panigation?
- single category widget with conditional terms
- why is the delete option missing from just one category?
- Get all categories
- Show category post order ASC
- How to display all category images for single post in a page?
- CPT Custom post type Tags & Categories not showing for ‘Editor’ user in editor