Sidebar on the Left – Twenty Twelve

A quick fix to move the sidebar location in a child theme of Twenty Twelve;

add these styles to style.css of the child theme:

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

/*-- move sidebar to the left --*/
@media screen and (min-width: 600px) {
	.site-content {
		float: right;
	}
	.widget-area {
		float: left;
	}
}

/* for IE8 and IE7 ----------------*/
.ie .site-content {
	float: right;
}
.ie .widget-area {
	float: left;
}

caveat: this simplified set of styles has some problems with the formatting of the widgets in the ‘front-page’ template, when viewed in older browsers such as IE7.

possible helpful styles:

.ie .template-front-page #secondary.widget-area { width: 100%; }
.ie .template-front-page #secondary.widget-area .first.front-widgets { width: 50.1%; margin-right: 3%; background: #f4f4f4; }
.ie .template-front-page #secondary.widget-area .second.front-widgets { width: 46.8%; margin-right: 0; background: #f4f4f4; }
.ie .template-front-page #secondary.widget-area .widget { width: 100%; }

Show Page Title and Content of the ‘Posts Page’ in WordPress

When you set a static front page and at the same time set a Posts Page, WordPress will automatically use index.php (or home.php *) to display the Posts Page; as described in the Codex, you’ll lose the output of the title and content of that page.
To show this information on the Posts Page, for instance as an introduction for the posts, add some code to index.php (or home.php):

<?php //this is to output the page title and content for a 'page for posts' page as set under  'settings' - 'reading'
	if( is_home() && !is_paged() && get_option('page_for_posts') ) { 
	$posts_page_id = get_option('page_for_posts'); ?>			
	<header class="entry-header">
		<h1 class="entry-title"><?php echo get_the_title($posts_page_id); ?></h1>
	</header><!-- .entry-header -->
	<?php $posts_page = get_page( $posts_page_id ); ?>
	<div class="entry-content posts-page-entry-content">
	<?php echo apply_filters('the_content', $posts_page->post_content); ?>
	</div><!-- .posts-page-entry-content -->	
<?php } ?>

Show Description for Header Images in Twenty Eleven

This code is for a child theme of Twenty Eleven, because the direct editing of the default theme is not recommended.

Since wp3.4, the function get_custom_header() takes care of some of the information of the header images, such as width, height, and also the description or attachment id.

If added in header.php of the child theme, before:

<?php endif; // end check for removed header image ?>

the code below extracts the description information and outputs it below the header image:

<?php 
if ( function_exists( 'get_custom_header' ) && is_child_theme() ) :
if( get_custom_header()->description ) {
$header_description = get_custom_header()->description;
} elseif ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $header_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, max($header_image_width,$header_image_height) ) ) ) && $header_img[1] >= $header_image_width ) {
$header_img_details = get_posts(array('p' => get_post_thumbnail_id( $post->ID ), 'post_type' => 'attachment'));
$header_description = $header_img_details[0]->post_content;
} elseif( $att_id = get_custom_header()->attachment_id ) { 
$header_img_details = get_posts(array('p' => $att_id, 'post_type' => 'attachment'));
$header_description = $header_img_details[0]->post_content;
} 
if( $header_description ) echo '<span class="header-description">' . $header_description . '</span>'; 
endif; 
?>

A commented version of the code is in pastebin http://pastebin.com/VbjxyMRF .

Advanced Filter for Tag Cloud Widget Css Classes

tag cloud widget colored with css
tag cloud widget advanced color styling

The default tag cloud widget does not offer a lot of formatting possibilities, partly because it only outputs one css class with a reference to the tag ID.
It uses an inline style, which outputs the font-size, to distinguish the tags according the number of post they belong to.

This filter function is coded to add a css class with the tag slug .tag-slug-{slug} and with a rounded tag size .tag-size-{number}, and to remove the inline style.

add_filter ( 'wp_tag_cloud', 'tag_cloud_widget_advanced_classes' );  

function tag_cloud_widget_advanced_classes( $taglinks ) { 
	$tags = explode('</a>', $taglinks);
	$regex1 = "#(.*tag-link[-])(.*)(' title.*)#e";         
	$regex2 = "#(.*style='font-size:)(.*)((pt|px|em|pc|%);'.*)#e"; 
	$regex3 = "#(style='font-size:)(.*)((pt|px|em|pc|%);')#e";         
	$regex4 = "#(.*class=')(.*)(' title.*)#e";         
	foreach( $tags as $tag ) {         
		$tag = preg_replace($regex1, "('$1$2 tag-slug-'.get_tag($2)->slug.'$3')", $tag ); //add .tag-slug-{slug} class   
		$size = preg_replace($regex2, "(''.round($2).'')", $tag ); //get the rounded font size       
		$tag = preg_replace($regex3, "('')", $tag ); //remove the inline font-size style
		$tag = preg_replace($regex4, "('$1tag-size-'.($size).' $2$3')", $tag ); //add .tag-size-{nr} class
		$tagn[] = $tag;
	}     
	$taglinks = implode('</a>', $tagn);     
return $taglinks; 
}

For the code, also see the pastebin.

The added css classes can for instance be used to color the tags according to the number of appearance; as you can see here in the tag cloud when you scroll down on the left.