1
所以,我有一个适当的页面结构,一种看起来像这样如何在WordPress中仅显示子子页面的子页面?
Location
- New York
- Restaurant #1
- Dinner Menu
- Lunch Menu
- Restaurant #2
- Dinner Menu
- Lunch Menu
所以,当我可以说,在餐馆中排名第1页,我希望它显示的排名第1只所有子页面。不幸的是,我现在的代码库正在返回纽约所有的子页面。
这里是我的代码:
if (is_page()) {
if($post->post_parent)
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->post_parent.'&echo=0');
else
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&echo=0');
if ($children) {
echo $children;
}
}