Since WordPress is having trouble recognizing your custom template files, you could use this instead.
Insert into your single.php
file. Based on your description above, it sounds like you don’t have a single.php
file so you will likely have to create one. If you do already have a single.php
file then there is likely still some confusion with your exact problem because a custom post would only display the index.php
template if there was no single.php
. Or you could just be confusing the two.
<?php
if( get_post_type == 'acme_product' ) {
// Put the template code to display the custom post type post
} else {
// Code for all other posts
}
?>
This will work in any of the default WordPress post related template files like categories, archives, etc.
Related Posts:
- What does this PHP function code mean? [closed]
- Get the ID of the latest post
- Change permalinks for posts but not for custom post types
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How make get_next_post() return first post when viewing last one
- post_row_actions for custom post type
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How can I add dropdown widget/box to admin post page?
- Custom permalinks – post type – hierarchical taxonomy’s
- How to show related posts by category or custom post type?
- Downsides to not using built-in “Posts” post type?
- ascending order custom post type
- add_meta_box: Datepicker like the one for postdate?
- [Plugin: Posts 2 Posts] Changing display order of connections
- Display taxonomy term only if there’s a value
- get_page_by_title() not returning anything [closed]
- How to show post title outside of loop? [closed]
- How do you use JavaScript to detect the homepage
- How to delete all posts from a custom post type?
- Update content of multiple pages/posts at once?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- CPT’s archive and single page not working [closed]
- How to create A-Z index listing for custom post types?
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to post twitter like updates on wordpress
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- apply filters only to specific post listing without check the url parameters
- How Can I Set the Post Author of a Post I Just Created With PHP?
- WordPress Orderby Numeric Value Not Working
- is there a way to retrieve posts that do not have a featured image assigned?
- Notice: Undefined index: suppress_filters
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- Post image in WordPress not appearing on home page
- custom post type category count shortcode
- Add post location with mile radius allowing search
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- How to sort posts in a custom post type by title in ascending order by default?
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- Create new custom post and post category of same name
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- WordPress notification if new post published
- How to handle new post from API request?
- Restrict category access to specific users/groups. Author always has access
- Modify Posts from Custom_Post_Type within the plugin
- Render a Post or Page using the correct file
- WordPress Count posts within a custom post type
- Copy/Move selected taxonomy terms to another taxonomy for posts
- WordPress post carousel
- Custom post type tags not showing in search
- How to setup different permlalinks for posts and pages?
- list articles in admin showing nested categories or slugs?
- Define multiple prefixes for custom post type
- Show posts from WP Custom Post Type selected from a field in a metabox
- wp_post_delete is deleting all offices
- order custom post type posts by custom date
- How to show posts of the same category on a page?
- Why doesn’t wp_delete_post allow trashing for custom types?
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- post type => ‘any’ not applied my custom queries
- Using Orderby and meta_value to order natural/alphanumerical
- call a function when insert and update a custom post type
- WP_posts (Not meta) extra custom field column show and change it in a custom post type
- how to make custom post with “publish” default functionality not save in draft?
- Post that populates itself (almost) automatically using data from imported excel file
- creating a custom post template
- Custom Post Type
- how to edit custom fields of type gallery from front-end
- Custom Post Status & Taxonomies
- Custom Post Type URL Rewriting
- How can I convert custom posts types into regular posts?
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- Post Editor: display categories from current post type taxonomy only?
- Get All post that is in table
- Front-end form submission not creating post
- Post being scheduled that shouldnt be schedulded
- custom field suit new post with in custom fields
- Using predefined html in new posts
- Change display wp post type to wp custom post type
- Dynamically change post_parent in every page load?
- Top 30 Songs using Custom Post Type
- How to make a list of posts displaying them 5 by 5 with a “next posts” link?
- Get custom post type parent category
- How to delete unnecessary custom post types in the UI
- show the most recent date of all posts to display on front end
- Error 403 when posting comments to a custom post type from a different page
- Two pagination in one page without AJAX
- Change post-name when inserting new Post if Specific Category is selected in WP