开发者

custom post types wordpress

开发者 https://www.devze.com 2023-01-03 23:00 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消