0
我有一個小問題。顯示grandchilderen的父母
在wordpress中,我有一個父母,一個孩子,一個孩子,一個孩子和一個偉大的孩子作爲頁面結構。
,我使用的代碼是這樣的:
function wpb_list_child_pages_popup() {
global $post;
if (is_page() && $post->post_parent)
$childpages = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0');
else
$childpages = wp_list_pages('sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0');
if ($childpages) {
$string = '<ul id="child-menu">' . $childpages . '</ul>';
}
return $string;
}
add_shortcode('wpb_childpages_popup', 'wpb_list_child_pages_popup');
我只看到當前子頁面或偉大的盛大孩子的父頁。
如何及時使用此代碼以確保當前頁面顯示列表中的2位父母?
謝謝,但事情是我在模板中使用簡碼。我怎麼能合併這兩個通過短代碼工作? – Dionoh