custom post types wordpress
I have created a custom post type cal开发者_高级运维led show.. How do I tell wordpress to go to show.php for loading the content instead of single.php?
This is crucial since single.php does not carry the code for the extra added fields I have, thats why I want to use show.php
thanks
The WordPress docs say your template file must be single-show.php
, not just show.php
.
single-<post-type>.php
The single post template used when a single post from a custom post type is queried. For example, single-books.php would be used for displaying single posts from the custom post type books. index.php is used if the query template for the custom post type is not present.
1.Copy single.php
.
2.Rename it single-show.php
.
3.Now modify this template as per your requirement.
精彩评论