Displaying Single Post of the Custom Post Type

Learn to create a page for displaying a single post of the custom post type.

When we visit a course post, we can see that the page is being powered by single.php. It displays a link Back to Blogs as well as the post metadata of author, date, and category. We would want the page to look different because a course post is different from a blog post. We need to create a template file for the course posts.

For a custom post type, WordPress is automatically on the lookout for single-{post-type}.php file. Recall this image from the Template Hierarchy lesson.

Get hands-on with 1400+ tech skills courses.