php*_*oob 0 wordpress custom-wordpress-pages
大家好,当我显示特定帖子时,我在 WordPress 中调用 single-{slug}.php 时遇到问题。
例如,我有一个名为 php 的帖子,所以我在主题目录的二十七文件夹中创建了一个文件 single-php.php 但它没有调用。
这是更正
\n\nsingle-{post-type}-{slug}.php \xe2\x80\x93 (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.\nRun Code Online (Sandbox Code Playgroud)\n\n参考:模板层次结构
\n\n所以对于单个帖子来说它将是 single-post-{slug}.php 。
\n| 归档时间: |
|
| 查看次数: |
1651 次 |
| 最近记录: |