Subpage not in Menu
-
Hi,
I am currently creating a custom theme.
One page consists subpages of a top-menu.
If the menu get’s clicked the page shows a list of the submenu’s that are beneath the page.
The submenu on the page works great, however when I look at the navigation I see that there is a subpage created under the main menu but this is nog what I want.In short:
The main menu is not allowed to have submenu’s showing.
The page only display’s the submenu.This is what I use for the mainmenu:
<?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'menu_class' => 'nav', 'theme_location' => 'primary-menu' ) ); ?>And this is what I use to get my submenu on a page:
<?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); foreach( $mypages as $page ) { $content = $page->post_content; if ( ! $content ) // Check for empty page continue; $content = apply_filters( 'the_content', $content ); ?> <h3><?php echo $page->post_title; ?></h3> <div class="entry"><a href="<?php echo get_page_link( $page->ID ); ?>">READ MORE »</a></div> <?php } ?>Can somebody tell me what I need to change to get the submenu out of the main menu and only on the page.
The topic ‘Subpage not in Menu’ is closed to new replies.