我有一个自定义帖子类型-电影。它具有Film_cat的分类法, 而后者又具有两个术语/类别-Term1和Term2。
对于Term1内的每个帖子, 我想显示一个特定的single.php模板。 Term2中的每个帖子也应该有自己的single.php模板。
我目前正在将taxonomy-film_cat-term1.php用于分类档案模板, 但是找不到有关如何根据分类术语创建不同的single.php模板的信息。
#1
你可以根据自定义帖子类型名称重命名它来创建single.php页面。
例如:
Your custom post type Name: Films
Your single.php will be: single-films.php
因此, 你可以在single-films.php上找到电影的所有帖子。希望我已经清除了自己
来源:
https://www.srcmini02.com/63918.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_41620.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57