<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TransformationPowerTools &#187; Wordpress</title>
	<atom:link href="http://www.transformationpowertools.com/wordpress/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.transformationpowertools.com/wordpress</link>
	<description>for personal growth and transformation</description>
	<lastBuildDate>Fri, 20 Jan 2012 13:23:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress Post Thumbnails with Caption</title>
		<link>http://www.transformationpowertools.com/wordpress/wordpress-post-thumbnails-with-caption</link>
		<comments>http://www.transformationpowertools.com/wordpress/wordpress-post-thumbnails-with-caption#comments</comments>
		<pubDate>Thu, 05 Jan 2012 19:26:06 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[support forum]]></category>
		<category><![CDATA[thumbnail]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1473</guid>
		<description><![CDATA[This is a tidying up of a WordPress support forum topic &#8211; nothing really that I came up with myself. The question is how to post the caption with a post thumbnail, aka featured image, in an ordered way. This &#8230; <a href="http://www.transformationpowertools.com/wordpress/wordpress-post-thumbnails-with-caption">capture it all ... <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a tidying up of a <a title="WordPress support forum link" href="http://wordpress.org/support/" target="_blank">WordPress support forum</a> topic &#8211; nothing really that I came up with myself.</p>
<p>The question is how to post the caption with a post thumbnail, aka featured image, in an ordered way.</p>
<p>This code below is tested in wp3.3.</p>
<pre class="brush: php; title: ; notranslate">//POST THUMBNAIL AND CAPTION STYLED SIMILAR TO .wp-caption//
function the_post_thumbnail_and_caption($size = '', $attr = '') {
global $post;

$thumb_id = get_post_thumbnail_id($post-&gt;id);

$args = array(
'post_type' =&gt; 'attachment',
'post_status' =&gt; null,
'parent' =&gt; $post-&gt;ID,
'include'  =&gt; $thumb_id
);

$thumbnail_image = get_posts($args);

if ($thumb_id &amp;&amp; $thumbnail_image &amp;&amp; isset($thumbnail_image[0])) {

$image = wp_get_attachment_image_src( $thumb_id, $size );
$image_width = $image[1];

$output = '&lt;div style=&quot;width: ' . ($image_width) . 'px&quot;&gt;';

$attr['class'] = ''; //move any 'class' attributes to the outer div, and remove from the thumbnail

$output .= get_the_post_thumbnail($post-&gt;ID, $size, $attr);

/* //Uncomment to show thumbnail title
$title = $thumbnail_image[0]-&gt;post_title;
if($title) :
$output .= '&lt;p&gt;';
$output .= $title;
$output .= '&lt;/p&gt;';
endif; */

/* //Uncomment to show the thumbnail caption */
$caption = $thumbnail_image[0]-&gt;post_excerpt;
if($caption) :
$output .= '&lt;p&gt;';
$output .= $caption;
$output .= '&lt;/p&gt;';
endif;

/* //Uncomment to show the thumbnail description
$descr = $thumbnail_image[0]-&gt;post_content;
if($descr) :
$output .= '&lt;p&gt;';
$output .= $descr;
$output .= '&lt;/p&gt;';
endif; */

/* //Uncomment to show the thumbnail alt field
$alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
if(count($alt)) :
$output .= '&lt;p&gt;';
$output .= $alt;
$output .= '&lt;/p&gt;';
endif; */

$output .= '&lt;/div&gt;';

}
echo $output;
}
</pre>
<p>(unfortunately, posting here removes the indents which would make the code easier to read)</p>
<p>Possible styles for that to make it look like an ordinary wp caption:</p>
<pre class="brush: css; title: ; notranslate">.thumbnail-caption { padding: 5px; background: #f5f5f5; border: 1px solid #ddd; }
.thumbnail-caption-text { text-align: center; margin-bottom: 5px; font-size: 90%; }
/*
.thumbnail-title-text { text-align: center; margin-bottom: 5px; font-size: 90%; }
.thumbnail-description-text { text-align: center; margin-bottom: 5px; font-size: 90%; }
.thumbnail-alt-text { text-align: center; margin-bottom: 5px; font-size: 90%; }
*/</pre>
<p>Use the code in the template, for instance in single.php, with one of the registered thumbnail sizes as parameter; example:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php the_post_thumbnail_and_caption('large',array('class' =&gt; 'alignleft')); ?&gt;</pre>
<p>A huge &#8216;thank you&#8217; to all the contributers to <a href="http://wordpress.org/support/topic/display-caption-with-the_post_thumbnail" target="_blank">this topic</a> in the forum.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/wordpress-post-thumbnails-with-caption/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mini SEO &#8211; a Meta Description Field for Posts and Pages</title>
		<link>http://www.transformationpowertools.com/wordpress/mini-seo-meta-description-field-for-posts-and-pages</link>
		<comments>http://www.transformationpowertools.com/wordpress/mini-seo-meta-description-field-for-posts-and-pages#comments</comments>
		<pubDate>Tue, 03 Jan 2012 19:49:30 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[meta description]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[search ranking]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[seo plugin]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1462</guid>
		<description><![CDATA[Modern search engines do not rely on meta descriptions and meta keywords anymore for your ranking. However, they do preferably show a proper added meta description instead of the first few words of the post or page. If you can &#8230; <a href="http://www.transformationpowertools.com/wordpress/mini-seo-meta-description-field-for-posts-and-pages">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Modern search engines do not rely on meta descriptions and meta keywords anymore for your ranking.</p>
<p>However, they do preferably show a proper added meta description instead of the first few words of the post or page.</p>
<p>If you can enter this meta description into your WordPress blog or CMS, specifically for each post and static page, you can fine tune what you would like your customers to see with the search results.</p>
<p>Most users would download and install one of the many SEO plugins, which often come with a lot of unwanted features.</p>
<p>With a bit of programming, you can add your own &#8216;Meta Description Field&#8217; below the post/page editor.</p>
<p>The first part of the code needs to be added into functions.php of your theme:</p>
<pre class="brush: php; title: ; notranslate">// 'Custom Meta Description' field below post/page editor
add_action('admin_menu', 'custom_meta_desc');
add_action('save_post', 'save_custom_meta_desc');
function custom_meta_desc() {
add_meta_box('custom_meta_desc', 'Add meta description &lt;small&gt;(if left empty, the first 200 characters of the excerpt will be used)&lt;/small&gt;', 'custom_meta_desc_input_function', 'post', 'normal', 'high');
add_meta_box('custom_meta_desc', 'Add meta description &lt;small&gt;(if left empty, the first 200 characters of the excerpt will be used)&lt;/small&gt;', 'custom_meta_desc_input_function', 'page', 'normal', 'high');
}
function custom_meta_desc_input_function() {
global $post;
echo '&lt;input type=&quot;hidden&quot; name=&quot;custom_meta_desc_input_hidden&quot; id=&quot;custom_meta_desc_input_hidden&quot; value=&quot;'.wp_create_nonce('custom-meta-desc-nonce').'&quot; /&gt;';
echo '&lt;input type=&quot;text&quot; name=&quot;custom_meta_desc_input&quot; id=&quot;custom_meta_desc_input&quot; style=&quot;width:100%;&quot; value=&quot;'.get_post_meta($post-&gt;ID,'_custom_meta_desc',true).'&quot; /&gt;';
}
function save_custom_meta_desc($post_id) {
if (!wp_verify_nonce($_POST['custom_meta_desc_input_hidden'], 'custom-meta-desc-nonce')) return $post_id;
if (defined('DOING_AUTOSAVE') &amp;&amp; DOING_AUTOSAVE) return $post_id;
$customMetaDesc = $_POST['custom_meta_desc_input'];
update_post_meta($post_id, '_custom_meta_desc', $customMetaDesc);
}
</pre>
<p>The second part will be added into header.php, below the &lt;title&gt; tag:</p>
<pre class="brush: php; title: ; notranslate">&lt;meta name=&quot;description&quot; content=&quot;&lt;?php
if(is_singular() ) :
$text = get_post_meta($post-&gt;ID,'_custom_meta_desc',true);
if(!$text) $text = ($post-&gt;post_excerpt) ? $post-&gt;post_excerpt : substr($post-&gt;post_content, 0, 200).'...';
echo htmlentities(strip_tags(apply_filters('get_the_excerpt',$text)));
else :
/* optional area to program meta descriptions for index and archive pages, etc */
endif; ?&gt;&quot; /&gt;
</pre>
<div id="attachment_1463" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-1463" title="metadesc" src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2012/01/metadesc-300x145.jpg" alt="meat description input field" width="300" height="145" /><p class="wp-caption-text">&#39;Meta Description Input&#39; for posts and pages</p></div>
<p>The new input field will show directly below the post or page editor window.</p>
<p>Simply add your meta description text into the field, and press the usual &#8216;update&#8217; button;<br />
if left empty, the meta description will show the first 200 characters of the post or page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/mini-seo-meta-description-field-for-posts-and-pages/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Page Template Sidebar Overwrite Theme Options in Twenty Eleven</title>
		<link>http://www.transformationpowertools.com/wordpress/page-template-sidebar-overwrite-theme-options-twenty-eleven</link>
		<comments>http://www.transformationpowertools.com/wordpress/page-template-sidebar-overwrite-theme-options-twenty-eleven#comments</comments>
		<pubDate>Fri, 23 Dec 2011 12:00:08 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[TwentyEleven]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[filter function]]></category>
		<category><![CDATA[page template]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[theme options]]></category>
		<category><![CDATA[twenty eleven]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1406</guid>
		<description><![CDATA[Twenty Eleven already comes with a page template to add a sidebar to static pages. However, this sidebar will always be on the same side as the sidebar on the front  page, ruled by the &#8216;theme options&#8217;. On some pages, &#8230; <a href="http://www.transformationpowertools.com/wordpress/page-template-sidebar-overwrite-theme-options-twenty-eleven">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Twenty Eleven already comes with a page template to add a sidebar to static pages. However, this sidebar will always be on the same side as the sidebar on the front  page, ruled by the &#8216;theme options&#8217;.<br />
<img class="alignleft size-medium wp-image-1412" title="left-right-sidebar-template" src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2011/12/left-right-sidebar-template-300x258.jpg" alt="example of left and right sidebars in static pages of Twenty Eleven" width="300" height="258" />On some pages, you might want to show the sidebar on the opposite side.<br />
This freedom of choice is possible with some special page templates and some coding in functions.php of the theme.</p>
<p>The following codes refer to a child theme of Twenty Eleven.</p>
<p>If you don&#8217;t want to follow the steps outlined in the <a href="http://codex.wordpress.org/Child_Themes" target="_blank">Codex</a>, you can download a ready-made child theme from <a href="http://quirm.net/download/80/" target="_blank">quirm.net</a>.</p>
<p>First step: in your child theme folder, create two new page templates &#8211; one for a fixed sidebar on the left, and the other for the sidebar on the right.</p>
<p>To begin with, copy the code of <em>sidebar-page.php</em>, and save it as <em>sidebar-left-page.php</em> and <em>sidebar-right-page.php</em>, resp.</p>
<p>The file names are important as they refer to the same names in the code for functions.php.</p>
<p>Second step: Change the line &#8216; * Template Name: Sidebar Template&#8217; to &#8216; * Template Name: Left  Sidebar Template&#8217; and &#8216; * Template Name: Right Sidebar Template&#8217;, resp.; save the files.</p>
<p>Third step: add the following code to functions.php of your child theme:</p>
<pre class="brush: php; title: ; notranslate">function twentyeleven_child_pagetemplates_body_classes( $wp_classes, $extra ){

  $classes = array();

  if( is_page_template( 'sidebar-left-page.php' ) ) :
  // correction for the Left Sidebar Template
    $classes[] = 'left-sidebar';
    $blacklist = array('right-sidebar','singular');
    // Filter the body classes
    foreach( $blacklist as $val ) {
      if (!in_array($val, $wp_classes)) : continue;
      else:
      foreach($wp_classes as $key =&gt; $value) {
        if ($value == $val) unset($wp_classes[$key]);
      }
      endif;
    }
  endif;

  if( is_page_template( 'sidebar-right-page.php' ) ) :
  // correction for the Right Sidebar Template
    $classes[] = 'right-sidebar';
    $blacklist = array('left-sidebar','singular');
    // Filter the body classes
    foreach( $blacklist as $val ) {
      if (!in_array($val, $wp_classes)) : continue;
      else:
      foreach($wp_classes as $key =&gt; $value) {
        if ($value == $val) unset($wp_classes[$key]);
      }
      endif;
    }
  endif;

return array_merge($wp_classes, (array) $extra, $classes );
}

add_filter( 'body_class', 'twentyeleven_child_pagetemplates_body_classes', 20, 2 );
</pre>
<p>That code will correct the body_classes of the theme, which are central to the layout of your site.</p>
<p>Finished.</p>
<p>Now you will have two more page templates available in the &#8216;page attributes&#8217; section when you create or edit a static page.</p>
<p>The sidebar position of these pages will be independant of the theme options (as long as one of the &#8216;content with sidebar&#8217; options is ticked).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/page-template-sidebar-overwrite-theme-options-twenty-eleven/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Styling the First Post Different</title>
		<link>http://www.transformationpowertools.com/wordpress/styling-first-post-different</link>
		<comments>http://www.transformationpowertools.com/wordpress/styling-first-post-different#comments</comments>
		<pubDate>Wed, 07 Sep 2011 12:02:54 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Easy Coding for Wordpress]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[conditional tag]]></category>
		<category><![CDATA[different style]]></category>
		<category><![CDATA[first post]]></category>
		<category><![CDATA[last post]]></category>
		<category><![CDATA[latest post]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1346</guid>
		<description><![CDATA[How to style the first / last / latest / newest post in a WordPress site different? The default advice usually is to use a counter variable and a conditional statement to check for the first post in the loop; &#8230; <a href="http://www.transformationpowertools.com/wordpress/styling-first-post-different">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How to style the first / last / latest / newest post in a WordPress site different?</p>
<p>The default advice usually is to use a counter variable and a conditional statement to check for the first post in the loop; that approach obviously works fine, however requires a few lines of extra code before and in the loop.</p>
<p>A more condensed approach is to use <code>$wp_query-&gt;current_post<!--formatted--></code> which returns the current post number in the loop, starting with 0 (zero) for the first post.</p>
<p>This can be combined with a check, if the page is really the first page, and not one of the paginated pages, using <code>!is_paged()</code>.</p>
<p>If the goal is just to apply different css styles to the first post, it is best to add a unique css class to the post_class() which is used in most recent themes; like so: <code>post_class($extra);</code> to add the extra class to post_class.</p>
<p>All combined might look like (based on the code of content.php in Twenty Eleven):</p>
<pre class="brush: php; title: ; notranslate">&lt;article id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; &lt;?php $extra = ( $wp_query-&gt;current_post == 0 &amp;&amp; !is_paged() ) ? 'specialclass' : ''; post_class($extra); ?&gt;&gt;</pre>
<p>If the goal is to have a totally different output for the first post, then a conditional structure is needed (within the loop, wrapping the post output):</p>
<pre class="brush: php; title: ; notranslate">&lt;?php if( $wp_query-&gt;current_post == 0 &amp;&amp; !is_paged() ) : ?&gt;
/*the output of the first post*?
&lt;?php else : ?&gt;
/*the output of all other posts*/
&lt;?php endif; ?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/styling-first-post-different/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twenty Eleven &#8211; Sidebar and Other Adaptations for Hand-held Devices</title>
		<link>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-adaptations-for-hand-held-devices</link>
		<comments>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-adaptations-for-hand-held-devices#comments</comments>
		<pubDate>Wed, 03 Aug 2011 12:51:58 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Easy Coding for Wordpress]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[TwentyEleven]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[handheld device]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[responsive css]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[small browser]]></category>
		<category><![CDATA[tablet pc]]></category>
		<category><![CDATA[twenty eleven]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1310</guid>
		<description><![CDATA[As the title says: how can you keep the sidebar on narrow screens such as the iPhone® or iPad® and set a minimum width for your site, using (a child theme of ) Twenty Eleven? The solution lies in the &#8230; <a href="http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-adaptations-for-hand-held-devices">Be responsive ... <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As the title says: how can you keep the sidebar on narrow screens such as the iPhone<sup>®</sup> or iPad<sup>®</sup> and set a minimum width for your site, using (a child theme of ) Twenty Eleven?</p>
<p>The solution lies in the responsive structure of the stylesheet.</p>
<p>This adaptation to the styles needs to be added at the end of style.css of (your child theme of) Twenty Eleven; some example styles, to set a lower limit to the page width, etc:</p>
<pre class="brush: css; title: ; notranslate">/* =Responsive Structure for narrow screens
* to keep min width and sidebar
-------------------------------------------- */
@media (max-width: 800px) {
     #page {
	   min-width: 500px;
         }
/* keep the sidebar - for right sidebar */
	.right-sidebar #main #content {
		margin: 0 29% 0 1%;
		width: 70%;
	}
	.right-sidebar #main #secondary {
		float: right;
		margin: 0 1% 0 1%;
		width: 24%;
	}
/* keep the sidebar - for left sidebar */
	.left-sidebar #main #content {
		margin: 0 1% 0 29%;
		width: 70%;
	}
	.left-sidebar #main #secondary {
		float: right;
		margin: 0 -1% 0 2%;
		width: 24%;
	}
/* correction for 'showcase' template */
	.page-template-showcase-php #main #primary.showcase {
		float: right;
		margin: 0 2% 0 2%;
		width: 96%;
	}
	.page-template-showcase-php #main #primary.showcase #content {
		margin: 0 6% 0 6%;
		width: 88%;
	}
	.page-template-showcase-php section.recent-posts {
		float: right;
		margin-right: 0pt;
		margin-left: 31%;
		width: 69%;
	}
	.page-template-showcase-php #main .widget-area {
		float: left;
		margin-right: -22.15%;
		margin-left: 0pt;
		width: 22.15%;
	}
/* correction for singular posts/pages without sidebar */
	.singular #main #content {
		margin: 0 8% 0 8%;
		width: 84%;
	}
/* keep floating footer widgets side-by-side at this size */
     #colophon #supplementary .widget-area {
          float: left;
          margin-right: 1%;
          width: 32%;
     }
}
</pre>
<p>The whole css got a bit longer than expected to care for the &#8216;showcase&#8217; template, and all possible layout options.<br />
Adjust the &#8216;minimum width&#8217; to fit the screen width of the targeted hand-held device.<br />
If you are using it with an alredy customized child theme of Twenty ten, you may need to adjusts some of the values and/or add more styles.</p>
<p>Not actually widely tested with iPhone<sup>®</sup>, iPad<sup>®</sup> or any other tablet PCs &#8211; all feedback is very welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-adaptations-for-hand-held-devices/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Twenty Eleven &#8211; Sidebar on Single Posts and Pages</title>
		<link>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages</link>
		<comments>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages#comments</comments>
		<pubDate>Sun, 10 Jul 2011 19:46:06 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[TwentyEleven]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[body_class]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[single post]]></category>
		<category><![CDATA[twenty eleven]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1270</guid>
		<description><![CDATA[How to add the sidebar back into the new default theme of WP3.2 - Twenty Eleven.
Twenty Eleven is a very versatile theme, however, the 'missing' sidebar on single posts or pages is quite disturbing for some users, loosing their advertising space or the main navigation.
To get the sidebar back is not that simple - style.css is quite complex, and the layout of a single post or page is done with a clever use of a specially introduced css class in the body tag. <a href="http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The new default theme of WP3.2 &#8211; Twenty Eleven &#8211; is a very versatile theme.<br />
However, the &#8216;missing&#8217; sidebar on single posts or pages is quite disturbing for some users, loosing their advertising space or the main navigation.<br />
To get the sidebar back is not that simple &#8211; style.css is quite complex, and the layout of a single post or page is done with a clever use of a specially introduced css class in the body tag.</p>
<h3>First step</h3>
<p>Create a child theme.</p>
<p>- create a new sub-folder under the /wp-content/themes folder, for instance: twentyelevenchild;<br />
- add a style.css file to that folder; content:</p>
<pre class="brush: plain; title: ; notranslate">/*
Theme Name: Twenty Eleven Child
Author: alchymyth
Description: a child theme, based on the 2011 theme for WordPress
Author URI: http://wordpress.org/
Template: twentyeleven
*/

@import url(../twentyeleven/style.css);
</pre>
<p>- add a functions.php file to that folder; to be used later;<br />
- optional: add a screenshot.jpg image to that folder, depicting the design of your child theme.</p>
<h3>Second step</h3>
<p>Add the call of the sidebar back.</p>
<p>Edit single.php and/or page.php and add</p>
<pre class="brush: php; title: ; notranslate">&lt;?php get_sidebar(); ?&gt;</pre>
<p>before the line</p>
<pre class="brush: php; title: ; notranslate">&lt;?php get_footer(); ?&gt;</pre>
<h3>Third step</h3>
<p>Suppress the <strong><em>.singular</em></strong> body_class from the single post or page.</p>
<p>To achieve this, add a filter to your new functions.php in your child theme folder.</p>
<pre class="brush: php; title: ; notranslate">add_filter('body_class', 'blacklist_body_class', 20, 2);
function blacklist_body_class($wp_classes, $extra_classes) {
if( is_single() || is_page() ) :
// List of the classes to remove from the WP generated classes
$blacklist = array('singular');
// Filter the body classes
  foreach( $blacklist as $val ) {
    if (!in_array($val, $wp_classes)) : continue;
    else:
	  foreach($wp_classes as $key =&gt; $value) {
	  if ($value == $val) unset($wp_classes[$key]);
	  }
    endif;
  }
endif;   // Add the extra classes back untouched
return array_merge($wp_classes, (array) $extra_classes);
}
</pre>
<p>(resources:</p>
<p>http://dev-tips.com/featured/remove-an-item-from-an-array-by-value</p>
<p>http://wordpress.stackexchange.com/questions/15850/remove-classes-from-body-class )</p>
<h3>Fourth step</h3>
<p>Fine-tuning of style.css</p>
<p>For instance:</p>
<pre class="brush: plain; title: ; notranslate">.single #author-info {
	background: #f9f9f9;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	margin: 2.2em 0% 0 0%;
	padding: 20px 35.4%;
}
</pre>
<p>There might be some more details which can be changed while customizing the styles of the child theme.</p>
<p>edit: thanks to member<strong> <a href="http://wordpress.org/support/profile/smijos">smijos</a></strong> of the wordpress support forum<strong>:<br />
</strong>some more styles, for the comment section, to make the theme look good:</p>
<pre class="brush: css; title: ; notranslate">#respond {
width: auto;
}
.commentlist {
width: auto;
}
.commentlist &gt; li.comment {
margin: 0px 0px 20px 102px;
width: auto;
}</pre>
<h3>PS: A Few Different Cases</h3>
<p>(updated and expanded)</p>
<p>this all concerns this line of code:</p>
<pre class="brush: php; title: ; notranslate">if( is_single() || is_page() ) :</pre>
<p>1) if you rather use the sidebar-page template that comes with the theme, to control if and when to show a sidebar on a static page, simply don&#8217;t edit page.php, and remove</p>
<pre class="brush: php; title: ; notranslate">|| is_page()</pre>
<p>from that line.</p>
<p>2) <a href="http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages#comment-5698">Zeaks </a>pointed out that the code also effects single attachment pages.</p>
<p>if you want the sidebar in these pages, edit image.php and add</p>
<pre class="brush: php; title: ; notranslate">&lt;?php get_sidebar(); ?&gt;</pre>
<p>before the &#8216;get_footer&#8217; line; also adapt the style of</p>
<pre class="brush: css; title: ; notranslate">.image-attachment div.attachment</pre>
<p>.</p>
<p>if you want your single attachment pages without sidebar, change to:</p>
<pre class="brush: php; title: ; notranslate">if( (is_single() &amp;&amp; !is_attachment()) || is_page() ) :</pre>
<h3>PPS</h3>
<p>If you don&#8217;t like coding, please do still create the child theme; however, for the rest, there is a plugin available:<br />
<strong><a href="http://wordpress.org/extend/plugins/twenty-eleven-theme-extensions/">&#8216;Twenty Eleven Theme Extensions&#8217;</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/twenty-eleven-sidebar-on-single-posts-and-pages/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Posts in Columns &#8211; A New Twist on an Old Problem</title>
		<link>http://www.transformationpowertools.com/wordpress/posts-in-columns-a-new-twist-on-an-old-problem</link>
		<comments>http://www.transformationpowertools.com/wordpress/posts-in-columns-a-new-twist-on-an-old-problem#comments</comments>
		<pubDate>Fri, 10 Jun 2011 14:47:15 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Easy Coding for Wordpress]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[3 column post]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[easy coding]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[grid style]]></category>
		<category><![CDATA[posts in columns]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1254</guid>
		<description><![CDATA[To organize posts into three columns, you first need to generate a column dependant css class for each post; this will be added to the post div within the loop. The core trick to generate different css classes for posts &#8230; <a href="http://www.transformationpowertools.com/wordpress/posts-in-columns-a-new-twist-on-an-old-problem">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To organize posts into three columns, you first need to generate a column dependant css class for each post; this will be added to the post div within the loop.</p>
<p>The core trick to generate different css classes for posts in the first coliumn, the second column, and the last column:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php $column = ($column == '') ? 'first' : (($column == 'first') ? 'middle' : (($column == 'middle') ? 'last' : 'first' )); ?&gt;</pre>
<p>This line of code needs to be within the loop, just before the post div.</p>
<p>To achieve more or less the same, you could obviously also use a counter variable and the modulus operator, as i have elaborated on in my earlier article <a href="http://www.transformationpowertools.com/wordpress/zebra-style-wordpress-loop">&#8216;More-Than-Zebra style WordPress loop&#8217;</a>. However, the above method is simpler and easier to apply within a single line of code.</p>
<p>The second step is to add this as a css class to the post div:</p>
<p>a &#8211;  assume a theme without the use of &#8216;post_class()&#8217;; the typical opening div would look like:</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;</pre>
<p>This is changed into:</p>
<pre class="brush: php; title: ; notranslate">&lt;div class=&quot;post &lt;?php echo $column; ?&gt;&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;</pre>
<p>b &#8211; in a theme using the &#8216;post_class()&#8217;, the new code would look like:</p>
<pre class="brush: php; title: ; notranslate">&lt;div &lt;?php post_class($column); ?&gt; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;</pre>
<p>Third and last step: to tell the browser what to do with the new css classes, add some styles to style.css of the theme:</p>
<pre class="brush: css; title: ; notranslate">/* .first, .middle, .last styling of posts on home page for three column */
.first, .middle, .last { width: 32%; float:left; clear:none!important; }
.first { margin-right: 2%; clear:both!important; }
.middle { margin-right: 2%; }</pre>
<p>Final details depend on the existing theme.</p>
<p>edit &#038; ps:<br />
if you just want to mark the first post in each row &#8211; for instance to add the &#8216;clear:both;&#8217; and a different margin there &#8211; try to work with:<br />
(example for 5 columns)</p>
<pre class="brush: php; title: ; notranslate">
&lt;div &lt;?php $column = ($wp_query-&gt;current_post%5 == 0) ? 'first' : ''; post_class($column); ?&gt; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/posts-in-columns-a-new-twist-on-an-old-problem/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The Death of Mystery Man</title>
		<link>http://www.transformationpowertools.com/wordpress/the-death-of-mystery-man</link>
		<comments>http://www.transformationpowertools.com/wordpress/the-death-of-mystery-man#comments</comments>
		<pubDate>Mon, 11 Apr 2011 10:54:41 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[branding]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[mystery man]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1218</guid>
		<description><![CDATA[Are you fed up with the little grey mystery man or his little weird monster brothers and sisters? You know what i mean &#8211; showing up in your comments for all those without a gravatar? Give them the push and &#8230; <a href="http://www.transformationpowertools.com/wordpress/the-death-of-mystery-man">the mystery solved ... <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Are you fed up with the little grey mystery man or his little weird monster brothers and sisters?</p>
<p><img class="aligncenter size-full wp-image-1220" title="the death of mystery man " src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2011/04/mystery.jpg" alt="" width="500" height="67" />You know what i mean &#8211; showing up in your comments for all those without a gravatar?</p>
<p>Give them the push and create your own design, supporting your own branding.</p>
<p>Here is how it is done:</p>
<pre class="brush: php; title: ; notranslate">add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo('template_directory') . '/images/own-gravatar.jpg';
    $avatar_defaults[$myavatar] = &quot;Own&quot;;
    return $avatar_defaults;
}</pre>
<p>Add the code to functions.php of your theme; get creative with your graphic; upload it into the images folder of your theme (you might need to adjust the code, if your theme images are in a different folder), and activate it as the new default comment avatar.</p>
<p>Life without Mystery Man will never be the same &#8230;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<div class="threadpost col-7">
<div class="post">
<pre><code>add_filter( &#039;avatar_defaults&#039;, &#039;newgravatar&#039; );
function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo(&#039;template_directory&#039;) . &#039;/images/own-gravatar.jpg&#039;;
    $avatar_defaults[$myavatar] = &quot;Own&quot;;
    return $avatar_defaults;
}<!--formatted--></code></pre>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/the-death-of-mystery-man/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Category Archive Navigation</title>
		<link>http://www.transformationpowertools.com/wordpress/category-archive-navigation</link>
		<comments>http://www.transformationpowertools.com/wordpress/category-archive-navigation#comments</comments>
		<pubDate>Sat, 09 Apr 2011 13:44:16 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Easy Coding for Wordpress]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[next/previous]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1212</guid>
		<description><![CDATA[A simple next/previous category navigation for the category archive; particular useful if you use your categories to organise your blog, for instance your products, or photos&#8230; the above has a commonly used html structure to help with formatting.]]></description>
			<content:encoded><![CDATA[<p>A simple next/previous category navigation for the category archive; particular useful if you use your categories to organise your blog, for instance your products, or photos&#8230;</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
foreach(get_categories() as $all_cat) {  $cat_ids[] = $all_cat-&gt;term_id; }
 $this_cat = get_query_var('cat');
 $this_cat_position = array_search( $this_cat, $cat_ids ); ?&gt;
&lt;div&gt;
&lt;div&gt;
&lt;?php $prev_cat_position = $this_cat_position -1;
 if( $prev_cat_position &gt;=0 ) {
 $prev_cat_id = array_slice( $cat_ids, $prev_cat_position, 1 );
 echo '&lt;a href=&quot;' . get_category_link($prev_cat_id[0]) . '&quot;&gt;&amp;laquo; ' . get_category($prev_cat_id[0])-&gt;name . '&lt;/a&gt;'; } ?&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;?php $next_cat_position = $this_cat_position +1;
 if( $next_cat_position &lt; count($cat_ids) ) {
 $next_cat_id = array_slice( $cat_ids, $next_cat_position, 1 );
echo '&lt;a href=&quot;' . get_category_link($next_cat_id[0]) . '&quot;&gt;' . get_category($next_cat_id[0])-&gt;name . ' &amp;raquo;&lt;/a&gt;'; } ?&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<p>the above has a commonly used html structure to help with formatting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/category-archive-navigation/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adjusting Caption Frame Width</title>
		<link>http://www.transformationpowertools.com/wordpress/adjust-caption-frame-width</link>
		<comments>http://www.transformationpowertools.com/wordpress/adjust-caption-frame-width#comments</comments>
		<pubDate>Wed, 30 Mar 2011 19:27:19 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[contempory]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[image caption]]></category>
		<category><![CDATA[shortcode]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=1173</guid>
		<description><![CDATA[WordPress captions come with a fixed frame which is set in the wordpress core file &#8216;media.php&#8217; in the &#8216;wp-includes&#8217; folder. The caption shortcode function adds a 5px wide space to the left and right of the image; and outputs the &#8230; <a href="http://www.transformationpowertools.com/wordpress/adjust-caption-frame-width">Check the whole post <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1177" title="standard_caption" src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2011/03/standard_caption.jpg" alt="" width="193" height="161" />WordPress captions come with a fixed frame which is set in the wordpress core file &#8216;media.php&#8217; in the &#8216;wp-includes&#8217; folder.</p>
<p>The caption shortcode function adds a 5px wide space to the left and right of the image; and outputs the new calculated width as in an inline style in the attachment div.</p>
<p><img class="alignleft size-full wp-image-1175" style="clear: left;" title="slim_caption" src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2011/03/slim_caption.jpg" alt="" width="193" height="161" />For WordPress users, a familiar picture which you can only influence within limits by avoiding a background color for the attachment div.</p>
<p>However, if you want to have a slim contempory design <strong>and </strong>a background color behind the caption text, this would simply not work.</p>
<p>You need a fix.</p>
<p>The code below can be added to functions.php of your theme to allow you to set the frame width on your captions (sitewide) to any amount you like.</p>
<p>You need to <strong>adapt a few .wp-caption styles</strong> in style.css of your theme, after you have successfully added the code &#8211; that is all.</p>
<p>There you have your new contempory slim image caption design.</p>
<pre class="brush: php; title: ; notranslate">add_shortcode('wp_caption', 'slim_img_caption_shortcode');
add_shortcode('caption', 'slim_img_caption_shortcode');
function slim_img_caption_shortcode($attr, $content = null) {
 // Allow plugins/themes to override the default caption template.
 $output = apply_filters('img_caption_shortcode', '', $attr, $content);
 if ( $output != '' )
 return $output;

 extract(shortcode_atts(array(
 'id'    =&gt; '',
 'align'    =&gt; 'alignnone',
 'width'    =&gt; '',
 'caption' =&gt; ''
 ), $attr));

 if ( 1 &gt; (int) $width || empty($caption) )
 return $content;

 if ( $id ) $id = 'id=&quot;' . esc_attr($id) . '&quot; ';

 $frame_width = 0; // frame width in pixels per side //

 return '&lt;div ' . $id . 'class=&quot;wp-caption ' . esc_attr($align) . '&quot; style=&quot;width: ' . ( 2 * $frame_width + (int) $width) . 'px&quot;&gt;'
 . do_shortcode( $content ) . '&lt;p class=&quot;wp-caption-text&quot;&gt;' . $caption . '&lt;/p&gt;&lt;/div&gt;';
}</pre>
<p>edit: added the css class .wp-caption-text</p>
<p style="text-align: center;">Another step to total freedom of design &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/adjust-caption-frame-width/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

