• Hello,

    I’m trying to exclude a page from the navigation menu of my website Souls of the Beach. I’ve read the documentation and it says that I have to add ‘exclude=pageid’ to the wp_list_pages function:

    <ul>
      <?php wp_list_pages('exclude=17,38' ); ?>
    </ul>

    I can’t find that code anywhere, though. I’m using twentyeleven,

Viewing 2 replies - 1 through 2 (of 2 total)
  • For removing a page from the menu, just go to:

    Appearance > Menus > under the Menu Structure, just remove the item you want there and save the changes.

    the theme does not use wp_list_pages().

    if you are not using the custom menu, it uses wp_page_menu() as a fallback.

    in a child theme https://codex.www.ads-software.com/Child_Themes of Twenty Eleven, in functions.php, add something like:

    //exclude pages from default menu//
    function twentyelevenchild_page_menu_args( $args ) {
    	if ( ! isset( $args['show_home'] ) )
    		$args['exclude'] = '17,38';
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'twentyelevenchild_page_menu_args' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customize wp_list_pages in twenty eleven’ is closed to new replies.