请帮助了解自定义帖子类型“视频”的代码:
If is single-video.php page {
list custom-taxonomy of video. Example actors
} Else { do nothing }
我尝试使用is\\u single、is\\u single、is\\u page\\u模板,但不可行。请帮助了解自定义帖子类型“视频”的代码:
If is single-video.php page {
list custom-taxonomy of video. Example actors
} Else { do nothing }
我尝试使用is\\u single、is\\u single、is\\u page\\u模板,但不可行。根据WordPress conditional docs 它应该是:
if ( is_singular( \'video\' ) ) {
// do conditional stuff
} else {
//do other stuff
}
此外,如果您希望在CPT不是视频时显示空白页或没有内容,则不需要else
所以你可以省略它。您还可以执行以下操作:if ( ! is_singular( \'video\' ) ) {
// do nothing
} else {
//do conditional stuff
}
我正在为我的网站使用“211”主题,我刚刚在单个贴子页面中看到了这一点。i、 e单个。php,没有侧栏,这意味着没有单一的小部件。php页面我怎么把它带回来