我试图让这个逻辑在 WordPress 小部件逻辑中工作:如果它不是主页或不是第 86 页,或者如果它是第 86 页的子项,则显示小部件。
!is_home || !is_page('86') || !is_child('86')
我已将此函数添加到functions.php:
function is_child($parent) {
global $post;
return $post->post_parent == $parent;
}
我试图让这个逻辑在 WordPress 小部件逻辑中工作:如果它不是主页或不是第 86 页,或者如果它是第 86 页的子项,则显示小部件。
!is_home || !is_page('86') || !is_child('86')
我已将此函数添加到functions.php:
function is_child($parent) {
global $post;
return $post->post_parent == $parent;
}