I’m a newbie in WordPress. I have created a custom post type for videos but I do not know how to display the post type in a page. For example I want when a user adds a video, he won’t have to select a video template when publishing the video and when they open the published video, the page opens up with a video player instead of opening a page. I want something like a custom page with the video player ready that all I have to do is give the video player the url for the video.Already have the code for the video player. How can I do this?
Share
To make a default template file for all your custom post type posts or pages, you can name your template file
single-{your-cpt-name-here}.phporarchive-{your-cpt-name-here}.phpand it will always default to this when viewing these posts or pages.So for example in
single-video.phpyou could put:or instead make a custom query to shape your desired output:
In your custom loop like the example above, there’s lots of available template tags (like
the_content) to choose from in WordPress.