2009-12-11, 22:04:44
Ok! i made it...
just use menu_data function and parent_slug tag:
i manage an old function discovered in an old post:
The getSubpagesList function (put in your functions.php theme file):
You can call where you want passing the slug of the parent page:
It shows all the pages with a particular parent slug
just use menu_data function and parent_slug tag:
i manage an old function discovered in an old post:
The getSubpagesList function (put in your functions.php theme file):
Code:
<?php
function getSubpagesList($parent) {
$data = menu_data();
$parent = $parent . "/";
$output = array();
$output[] = '<ul>';
foreach( $data as $menu) {
if ($menu['parent_slug'] == $parent){
$output[] = "<li><a href='" . $menu['url'] . "' title='" . $menu['title'] . "'>"
. $menu['title'] . $menu['parent'] . "</a></li>";
}
}
$output[] = '</ul>';
$menu_string = implode("\n", $output);
echo $menu_string;
}
?>
You can call where you want passing the slug of the parent page:
Code:
<?php getSubpagesList('events');?>
It shows all the pages with a particular parent slug