The single.php
template is loaded when you visit a post. The archive.php
page is a generic archive template, loaded in case a grouping of posts (a year, a month, a category, a tag, etc.) does not have it’s own template.
Please read this about template hierarchy.
If you want to create a custom post template for a specific post_type
you have to create a dedicated template and call if single-post_type.php
(replace post_type
with your post type, i.e. product
).
Related Posts:
- Filtering a custom post type by custom taxonomy in archive template
- Why are posts from custom post type not displayed in “category” archive?
- Displaying category archive of custom post types
- How to build a complex page structure
- Custom Post Type Archive URL takes over page URL
- Template tags to display custom post type posts in category template?
- Regex problem in an add_rewrite_rule
- Custom post type archive sorted and grouped by date in post meta field
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Category page only displaying the posts from a custom type
- custom taxonomy archive by year
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- CPT Archive with core Category
- Custom Post Type Archive Page Filtering
- Custom post types and category archive
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- multiple custom post type on category page
- Meta data (Tags and Categories) for Custom Posts not showing.
- Archive links for custom post types
- Include custom post type custom taxonomies in Categories widget
- Archive Template being used instead of Category Template for Custom Post Type
- Why does my URL keep returning 404 error code?
- Menu’s breaking, now showing all page links on site
- Advanced archive url structure (category, tag and date)
- How can I tell if I’m on a custom post type archive page?
- Display all Categories except ones with a specific parent
- Custom post category name showing empty
- Save data is post using php front end
- Custom WordPress theme not displaying posts from category
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Custom Post Type archive page listing a 404 or single post
- Get meta values from parent post and save in child post
- Adding Custom Post Types to category/tag/author archives breaks header content
- Custom category taxonomy – archive page not showing up
- Help with Multi Level Category Archive Page
- How can I generate a list of post-type specific categories?
- How To Display Category list from Portfolio post type plugin?
- Custom Post type archives / categories give 404
- archive.php can’t find categorized posts
- Having some trouble properly displaying Custom Post Types in templates
- How can I set up the URL for a category archive for a custom post type?
- Categories in custom post types
- Stop header code from showing in category page?
- Category names on CPT archive pages [closed]
- Show custom post type on post category page doesn’t work / breaks navigation
- Separate archive template to show posts and CPT by same category/taxonomy
- WordPress Custom Post Type Archive, filter by category and get pagination working
- Is it possible to place custom post type files inside a folder in theme directory?
- Use post as category
- How to get the post type from a category id?
- Displaying a custom post types custom taxonomy value?
- How to add custom post types to normal category pages
- Pagination on category page with custom post types
- Insert HTML inside link in a walker
- Replace title column in post list with post meta value
- Custom Post Types and independent Categories – complex Taxonomy
- Call custom post type by category
- Add category attribute to custom shortcode
- Metadata for a taxonomy – is there any WordPress way of doing this?
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Custom post types archive redirect
- List all images from a single post meta value
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Use regular category with custom post types
- orderby in custom WP Query does not work
- Should I use custom taxonomy or custom post type
- Populate Custom Fields in a Custom Post Type?
- just can’t get date-based archives per post-type to work
- How to detect filter in URL in Category page?
- Set menu active state for custom posttype and category, given custom taxonomy term
- Archive page for taxonomy terms
- How to show CPTs in term archive
- How to change post featured image using a custom field of category?
- Custom template page with custom archives listing by user
- Insert Multiple Post with Same Publish Button
- Update CPT post meta with update_post_meta and cron job
- Group posts by custom post type
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- What’s the difference between same wp functions get_posts(); functions in different form?
- How can i change the output of posts_nav_link();
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Display all posts in main category and 1 subcategory
- Replace li Items with divs with classes
- Ordering posts in Search & taxonomy by post_meta
- showing custom post types of a certain category only
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Insert post metadata for all posts in CPT at once if metadata no existent
- Get posts from a custom post type by child categories of a parent category
- Display custom post type from dynamic custom field
- Linking to the most recent post in a Custom Post Type
- Root slug of taxonomy returning 404
- Show the same Article Available in Other Categories
- how to delete all users and posts based on ‘user_meta’?
- Getting posts under the custom post type ui category
- Show category ID on custom post type
- How to modify archive query with pre_get_posts to append CPTs?
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?