我想检查一下im是否在子页面上。在主页上是:
<?php if(is_front_page()): ?> <?php endif; ?>
但是当它是另一页时该怎么办?
这实际上是来自文档:
没有检查页面是否为子页面的功能。我们可以解决这个问题:
if ( is_page() && $post->post_parent > 0 ) {
echo "This is a child page";
}
我想检查一下im是否在子页面上。在主页上是:
<?php if(is_front_page()): ?> <?php endif; ?>
但是当它是另一页时该怎么办?
这实际上是来自文档:
没有检查页面是否为子页面的功能。我们可以解决这个问题:
if ( is_page() && $post->post_parent > 0 ) {
echo "This is a child page";
}