Exclude Pages from Default Menu in Twenty Eleven

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.

WordPress Changing Pluggable Functions Without Child Theme

A new concept (?) – to change a pluggable function of a WordPress theme without creating a child theme.

Example – to remove the  post tags output from the posts of Twenty Twelve.

Often, these things can be done by editing the styles of the theme, however in this case, CSS would not work as the tags don’t have their own CSS class.

Creating a child theme is usually recommended as the easiest option; but this might be over the top if the only changed paremeters are from some pluggable functions.

The alternative way would be to create a plugin to alter (in this example) the post-meta-data output, which is done through the function ‘twentytwelve_entry_meta()’.

How to:
use FTP to create a file, for example with the file name twentytwelve-entry-meta-modified.php, in the /wp-content/plugins/ folder; and add this example code (http://pastebin.com/7dMVvC9E)

Plugin Name: Entry Meta Twenty Twelve Modified
Plugin URI: n/a
Description: personalization of the entry meta of Twenty Twelve without child theme; in this particular example the removal of the tags.
Version: 1.0
Author: alchymyth
Author URI: http://transformationpowertools.com
License: GPL2

add_action( 'setup_theme', 'modify_pluggable_theme_functions' );

function modify_pluggable_theme_functions() {

if( wp_get_theme() == 'Twenty Twelve' && get_stylesheet_directory() == get_template_directory() ) :
//check for the right theme and that no child theme is used
function twentytwelve_entry_meta() {
// Translators: used between list items, there is a space after the comma.
$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );

$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time datetime="%3$s">%4$s</time></a>',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )

$author = sprintf( '<span><a href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),

if ( $categories_list ) {
$utility_text = 'This entry was posted in %1$s on %2$s<span> by %3$s</span>.';
} else {
$utility_text = 'This entry was posted on %2$s<span> by %3$s</span>.';


The code checks that Twenty Twelve is the active theme, and that no child theme is activated.

Activate the plugin ‘Entry Meta Twenty Twelve Modified’ as usual from within dashboard – plugins.


Linking or Enqueuing Stylesheet in WordPress Themes

There are several ways of adding a stylesheet to a WordPress theme;

A: linking the stylesheet (in the head section of header.php)

– linking the main stylesheet style.css:

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />


<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory(); ?>" />

– linking another stylesheet custom.css:

<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/custom.css" />

B: enqueuing the stylesheet (in functions.php)

– enqueuing the main stylesheet style.css of a theme:

function theme_styles() {
	wp_enqueue_style( 'theme-style', get_stylesheet_uri() );
add_action( 'wp_enqueue_scripts', 'theme_styles' );

– enqueuing another stylesheet custom.css of a child theme:

function child_theme_styles() {
	wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/custom.css' );
add_action( 'wp_enqueue_scripts', 'child_theme_styles', 20 );

C: using @import in an existing stylesheet

– example linking the parent theme’s style.css in a child theme’s style.css

@import url('../parentheme/style.css');


WordPress Theme Development – style.css

link html
enqueue stylesheet