2012-08-21, 22:22:05
n00dles101 Wrote:Hi and welcome to the forums...
Without having to install any plugins you could put the following function into your theme/functions.php file (create one if it doesn't exist)
Code:function getSubMenu($page){
$children=getChildren($page);
foreach ($children as $subpage){
$title=returnPageField($subpage,'menu');
$url=returnPageField($subpage,'slug');
echo '<li><a href="index.php?id='.$url.'">'.$title.'</a></li>';
// or use below if you have fancy urls on
//echo '<li><a href="/'.$url.'">'.$title.'</a></li>';
}
}
Then in your theme, put this in your sidebar:
Code:<ul>
<?php getSubMenu($id); ?>
</ul>
Change $id to a specific page slug to get a specific subpages, otherwise it will create subpages for whatever page your on.
This solution works to do what i want to accomplish, however it doesn't display the title of the page until it has been re-saved. Not a clue how this can be. Have you experienced this?