为什么 single-{slug}.php 不在 wordpress 中调用单个 post 显示?
Why single-{slug}.php not calling in wordpress for single post display?
大家好我在显示特定 post.
时在 wordpress 中调用 single-{slug}.php 时遇到问题
例如,我 post 调用了 php,所以我在主题目录的 twentyseventeen 文件夹中创建了一个文件 single-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.
所以它将是单-post-{slug}.php 单post.
大家好我在显示特定 post.
时在 wordpress 中调用 single-{slug}.php 时遇到问题例如,我 post 调用了 php,所以我在主题目录的 twentyseventeen 文件夹中创建了一个文件 single-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.
所以它将是单-post-{slug}.php 单post.