我使用此代码列出当前页面的子页面,并使用类似代码获得所有祖先的子页面,以便在侧栏上下文层次导航菜单中使用:
$pageset = get_posts(\'numberposts=0&post_type=page&post_parent=\'.$wp_query->post->ID);
出于某种原因,两次迭代都忽略了具有两位数帖子id的帖子。其他一切都显示得很好。我错过什么了吗?我是否有不正确的设置?我在这里撞到头了。。。
我使用此代码列出当前页面的子页面,并使用类似代码获得所有祖先的子页面,以便在侧栏上下文层次导航菜单中使用:
$pageset = get_posts(\'numberposts=0&post_type=page&post_parent=\'.$wp_query->post->ID);
出于某种原因,两次迭代都忽略了具有两位数帖子id的帖子。其他一切都显示得很好。我错过什么了吗?我是否有不正确的设置?我在这里撞到头了。。。
可能是因为你正在使用numberposts=0
如果要返回所有帖子,则需要使用-1
不0
如何将此(或类似内容)包括在内<?php if ( get_post_meta($post->ID, \'url\', true) ) { ?> <a href=\"<?php echo get_post_meta($post->ID, \"url\", $single = true); ?>\"><?php the_post_thumbnail(\'\');?></a> <?