If you CPT is called “work“, i.e. you have registered it using
register_post_type('work', $args);
you have to create a file called 'single-work.php'
and that will be used to show the singular work post.
If you don’t create that file the file 'single.php'
,if present, will be used by WordPress. If even the 'single.php'
does not exist in your theme, then the 'index.php'
file will be used.
Please see WordPress Template Hierarchy on Codex for more info.
Related Posts:
- 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?
- Enable sticky posts to custom post_type
- 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
- 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
- Loading post content in FancyBox
- How to show related posts by category or custom 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
- get_queried_object error How to show post count by month in the taxonomy page
- CPT’s archive and single page not working [closed]
- How to create A-Z index listing for custom post types?
- 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
- is there a way to retrieve posts that do not have a featured image assigned?
- Deleting Custom Post type data using mySQL command
- Showing posts from different categories and from custom post type
- Post image in WordPress not appearing on home page
- Custom Post Slug same as Parents Category Slug
- How to get all tags of a custom post type by id
- How to define which register_post_status goes to which register_post_type?
- 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
- Load Next WordPress Posts With AJAX?
- Multiple pages per post (not pagination)
- If there is only one post (show elements) else (show other elements)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- Custom post type menu
- 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
- How do I edit the WordPress post.php file?
- Posts are not rendering perfectly [closed]
- 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
- Post/Custom Post Type URL Access
- Create a custom post type based on ‘Post’
- Adding /blog in front of single posts (only)
- Invalid content when I try to import custom post type from the old template wordpress
- list articles in admin showing nested categories or slugs?
- How to set post date in post_type so that it’s same as latest post in category
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- Define multiple prefixes for custom post type
- Create a post automatically if search result has zero results
- Publishing failed. The response is not a valid JSON response
- add all blog posts to folder
- Show posts from WP Custom Post Type selected from a field in a metabox
- order custom post type posts by custom date
- How to show posts of the same category on a page?
- Bulk trashing post ‘fails’
- custom post type to post association in wordpress
- Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?
- How to get all posts related to a taxonomy?
- call a function when insert and update a custom post type
- Work and Display a Custom Post Type as a normal Post
- Most efficient way of showing children posts?
- How to add New Post On clicking a button?
- Custom post type with two templates
- One Post with different content, depending on a Page
- Custom Post Type
- Popup panel is only displaying 1 entry ignoring all others
- Custom Post Status & Taxonomies
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Front-end form submission not creating post
- Linking custom taxonomies and posts
- Search page for custom post type
- Post being scheduled that shouldnt be schedulded
- how to remove user name and date in post page
- 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
- Canot save post if any meta box was empty
- Error 403 when posting comments to a custom post type from a different page
- How to make a non-public post on wordpress approval?
- How Do I Add a Custom Post Type URL to Content?
- is therer any wordpress function to retrieve a specific html element from post content