Advertisements

twentyeleven_layout_classes

Definition:
function twentyeleven_layout_classes( $existing_classes ) {}

Adds Twenty Eleven layout classes to the array of body classes.

Parameters

  • $existing_classes

Defined filters

  • twentyeleven_layout_classes
    apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout )

Source code

function twentyeleven_layout_classes( $existing_classes ) {

	$options = twentyeleven_get_theme_options();

	$current_layout = $options['theme_layout'];



	if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )

		$classes = array( 'two-column' );

	else

		$classes = array( 'one-column' );



	if ( 'content-sidebar' == $current_layout )

		$classes[] = 'right-sidebar';

	elseif ( 'sidebar-content' == $current_layout )

		$classes[] = 'left-sidebar';

	else

		$classes[] = $current_layout;



	$classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );



	return array_merge( $existing_classes, $classes );

}

14743

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: