Esempio:Come ottenere tutte le pagine figlio di una pagina madre in Wordpress?
About
--- Menu 1
--- Menu 2
--- Menu 3
--- Menu 4
se sto in circa pagina ... ho le sottopagine. ma, se entrare nel menu di 1 tutte le pagine scompaiono
cosa ho bisogno è tutto il tempo vedere le pagine genitore
Attualmente ho questo codice
<? if (is_page()) {
$g_page_id = $wp_query->get_queried_object_id();
wp_list_pages("depth=4&title_li=&child_of=".$g_page_id."&sort_column=menu_order");
}
?>
Grazie!
risolto
Io uso questo e fine lavoro!
<?php if (is_page()) { ?>
<?php
if($post->post_parent)
$children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'); else
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ($children) { ?>
<div class="title"><?php
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
?><span></span></div>
<ul>
<?php echo $children; ?>
</ul>
<?php } } ?>
Si dovrebbe provare a cercare la prossima volta. Prova questo http://stackoverflow.com/questions/9190427/how-to-get-all-child-pages-of-a-page-by-the-parent-page-title-in-wordpress –
Questo codice non lavoro per me, ho un errore. – krathos