A custom template for one specific category should be named category-slug.php
where “slug” is the WP slug for the category. WordPress will automatically use this file to display the archive for that one category.
You could also name it using the ID of the category.
If your category is “legacy-posts”, then your template file should be named category-legacy-posts.php
.
Related Posts:
- Why have on every line
- Function to return true if current page has child pages
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Inject post (from specific category) between posts in Loop
- Get author full name
- Remove option to allow trackbacks/pingbacks from post page options
- How to remove hardcoded characters from playlists?
- Display posts by month
- is there a simple way to list every templates / php files used to generate a specific page?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Guidance with The Loop for CMS
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- How can I loop into two different DIVS without repeating the DIVs
- WordPress loop specific thumbnail size
- Widgets not showing in my custom theme
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- Exclude posts from homepage having a specified tag
- How to get 2 or multiple custom post types in wordpress functions.php
- Displaying theme options in css
- Creating bulk posts with Youtube videos
- Hide wordpress field if data is empty in post!
- Customizer: Output default value in Customizer CSS
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Changing layout with wp_customise
- Converting HTML Template to WordPress Theme
- How to show part of the_content?
- How can I add extra word in permalink when someone click download button?
- Customizer: active_callback and sanitize_callback incompatibility?
- Menu jumping when calling it via PHP
- remove post that has no content
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Custom posts in different columns style
- Redirect to another page using contact form 7? [closed]
- How to obtain the current website URL in my theme?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Underscore – Self hosted fonts
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to avoid duplicates when creating recent network posts
- How to show an entire post content and not also the excerpt?
- Why in my theme I can’t see all the statics content under the posts?
- WordPress query undefined offset in loop
- Only show first image in foreach loop
- Get all posts as an array ID => Name
- home.php show blog posts as grid view
- Do not duplicate posts with multiple categories in multiple loops
- Update if post with specific title exists
- Is there a hack for using is_page() within the function.php file?
- How to pick “full/thumbnail” images in the loop?
- Why when I create a new post I found 2 record related to this post into the posts database table?
- How to Fix an Archive.php That Displays All Posts?
- pass html code to worpdress
- pagination broken – clicking next displays “page not found”
- Search.php gets metadata from first post
- Wp Query : Order by distance lat,lon
- Display articles with a different template in the home page | Solved |
- Check if current post in loop is last on current page
- update_user_meta as multiple value but with same meta key
- Is there anyway I can call the year once?
- Looping through dummy posts and showing them in the main index.php
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- How do if all posts has this category ID then do this
- Get current_post in reverse order with pagination
- How to get php file based on URL in WordPress
- Problems with the WordPress loop [closed]
- How can I customize a WordPress theme before it’s downloaded?
- Add div after every 4 posts then every 2 posts for a responsive loop
- Only display notification on single post
- Insert div after every three posts in home.php [duplicate]
- Where can I find the declaration of `$_wp_theme_features`?
- Display tab title as ‘blog tagline | blog title’
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- WordPress get_post_meta issue
- How to show the posts list into a static page? Problems to use the loop into a static page
- Automatically create a loop for post ID
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- Auto create description in post
- Pagination on Custom Loop
- why is this content-template not showing any of my blog-entries?
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- Post thats in Two Categories, only want to display name for one
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Excerpt all post content Content Same Size without word cutting off
- How to create a loop that will display one post and stop?
- Woocommerce linking variations
- Pagination not working properly
- $_html is empty when var dumped
- Add multiple HTML attributes to an Elementor button
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Count the number of matching post names in foreach loop
- How to add default images into theme customizer image control?
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- Setting at job with shortcode not working