83 | Exclude Pages from Default Menu in Twenty Eleven

g+

If you are not using the custom menu, the theme uses `wp_page_menu()` as a fallback.

As always, start by creating a child theme of Twenty Eleven; http://codex.wordpress.org/Child_Themes

To exclude pages from the default menu, edit functions.php in the child theme and add something like:

//exclude pages from default menu//
function twentyelevenchild_page_menu_args( $args ) {
		$args['exclude'] = '17,38';
	return $args;
}
add_filter( 'wp_page_menu_args', 'twentyelevenchild_page_menu_args' );

The numbers refer to the page IDs of the pages you want to exclude.

This entry was posted in Easy Coding for Wordpress, Twenty Eleven, WordPress and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*