嘿,当我显示特定帖子时,我遇到的大家都在WordPress中呼叫单{slug} .php。
例如,我的帖子称为php,所以我在主题目录的二十七个文件夹中创建了一个文件单php.php,但它没有调用。
这是校正
single-{post-type}-{slug}.php – (Since 4.4) First, WordPress looks for a template for the specific post. For example, if post type is product and the post slug is dmc-12, WordPress would look for single-product-dmc-12.php.
参考:模板层次结构
因此,它将是单件{slug} .php。