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
- Storing revisions of metadata for custom post type
- Add Category Taxonomy Support to Custom Post Type
- Pagination throws 404 error on custom taxonomy archive pages
- Custom Post Type with Input fields to seperate table on database.
- How Can I save multiple records in same meta key?
- How to Add Pages Under Custom Post Type URL Structure?
- Creating a custom post type upon registration
- Structuring a product catalogue in WordPress [closed]
- Showing Meta Data for Custom Post Types?
- Having trouble with custom post type / meta box
- Query for posts from any post type but only add instock products
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- Using date stored as custom field to filter posts displayed in admin
- Show Post Count of a Category
- Meta Box Only in CPT Edit Page, Not in Add New
- Filter categories of posts with checkboxes
- Custom meta box data array: foreach not working correctly?
- Display all posts in main category and 1 subcategory
- How to check if user meta field is empty in conditional else statement
- Custom post type getting wrong categories and tags
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- How to produce a sub-page-system in WordPress
- Meta Data for Custom Post Type not saving
- Listing all slugs?
- Template Hierarchy for custom post type pages
- List categories, subcategories and posts from custom taxonomy and custom post type
- Custom Post type content within a slider
- Categories won’t appear on custom post type
- How can I get some of a posts meta data whilst it is still inserting?
- Archive page for custom post type and custom taxonomy
- How to order custom posts by one of the custom fields value, ‘date’?
- WordPress giving me the index
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- How can I write a function that would update any missing specific post metadata?
- Sudden 404 pages on product category archives
- Convert category to custom post type
- How can I display a specific category on Front-Page
- Archive for custom taxonomy
- Custom Function to redirect singular post if specific meta field is empty
- How to seperate posts by categories?
- WooCommerce change
- Custom Post Type is not respecting assigned categories
- Saving Child Terms on front end not setting parent
- Help with Travel Guide Setup
- update a posts of other custom post type
- Project Category Heading
- Getting Custom post category from Form
- date archive future posts
- Front end page submission form does not attach custom post type
- Category slug not showing for Custom Post Type
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- How to determ a custom post type url?