Codecanyon: UberMenu – WordPress Mega Menu Plugin
UberMenu – WordPress Mega Menu Plugin
Reply
<?php 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) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
Display parent headline and a list of children links in a submenu.
In this illustrative example:
The headline in the left column is Services both on parent as well as children page.
And this is the code:
<h2><?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?></h2> <?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) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>
<?php wp_list_pages('child_of=8'); ?>
8 referer til sidens id nr.
Husk at give siderne numre (Rækkefølge i højre side), hvis du ikke vil vise undermenuen alfabetisk.