<?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>Sun, 15 Aug 2010 22:14:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Front Page Comments on your WordPress Blog</title>
		<link>http://www.transformationpowertools.com/wordpress/front-page-comments-wordpress-blog</link>
		<comments>http://www.transformationpowertools.com/wordpress/front-page-comments-wordpress-blog#comments</comments>
		<pubDate>Mon, 02 Aug 2010 11:44:18 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[comments_template]]></category>
		<category><![CDATA[front page]]></category>
		<category><![CDATA[TwentyTen]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=934</guid>
		<description><![CDATA[You want to show the comments to the posts on the front page of your blog?
You want to allow visitors to your blog to leave a comment on the latest post without having to click on the comments link or the post title?
You think this should be straight forward and easy to do?
But far from it&#8230;
First step is to locate the template file that shows your front page:  in most cases,
this is index.php (but  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/front-page-comments-wordpress-blog">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>You want to show the comments to the posts on the front page of your blog?</p>
<p>You want to allow visitors to your blog to leave a comment on the latest post without having to click on the comments link or the post title?</p>
<p>You think this should be straight forward and easy to do?</p>
<p>But far from it&#8230;</p>
<p>First step is to locate the template file that shows your front page:  in most cases,<br />
this is index.php (but it could also be home.php, or any page template that was set to be shown on the front).</p>
<p>Second step is to add <strong>comments_template(  &#8221;, true );</strong> within the loop, after <em>the_content()</em>, and maybe after any postmetadata.</p>
<p>However, this is not enough, because the wordpress template tag <em>comments_template()</em> has some check build-in, to make sure that comments are normally only be displayed either on a single article or page.</p>
<p>Find this in /wp-includes/comment-template.php line 858:<br />
<code>if ( !(is_single() || is_page() || $withcomments) || empty($post) )<br />
          return;</code></p>
<p>The code provides the use of a global variable <em>$withcomments</em> that can be set to boolean <em>true</em> (or 1) to allow the display of comments.</p>
<p>Putting it all together, here is what to add into your font page template where you want the comments and comments form to show:<br />
<code>&lt;?php global $withcomments; $withcomments = true;<br />
comments_template( &#039;&#039;, true ); ?&gt;<!--formatted--></code></p>
<p>For those, who find the structure of the new wp3 default theme TwentyTen difficult to work with, here a direct pointer:<br />
you will find the code to edit in loop.php after line 135:<br />
<code>			&lt;div class=&quot;entry-content&quot;&gt;<br />
				&lt;?php the_content( __( &#039;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;/span&gt;&#039;, &#039;twentyten&#039; ) ); ?&gt;<br />
				&lt;?php wp_link_pages( array( &#039;before&#039; =&gt; &#039;&lt;div class=&quot;page-link&quot;&gt;&#039; . __( &#039;Pages:&#039;, &#039;twentyten&#039; ), &#039;after&#039; =&gt; &#039;&lt;/div&gt;&#039; ) ); ?&gt;<br />
			&lt;/div&gt;&lt;!-- .entry-content --&gt;<br />
&lt;?php global $withcomments; $withcomments = true;<br />
comments_template( &#039;&#039;, true ); ?&gt;<br />
<!--formatted--></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/front-page-comments-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Image Rotator for the Header of Twentyten</title>
		<link>http://www.transformationpowertools.com/wordpress/image-rotator-for-header-twentyten</link>
		<comments>http://www.transformationpowertools.com/wordpress/image-rotator-for-header-twentyten#comments</comments>
		<pubDate>Sat, 24 Jul 2010 11:39:03 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[image rotator]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[TwentyTen]]></category>
		<category><![CDATA[wp3]]></category>
		<category><![CDATA[wp3 default theme]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=924</guid>
		<description><![CDATA[The wp3 default theme TwentyTen comes with a choice of header images, which can be selected from the dashboard.
To rotate these images to show randomly in the header, we can make use of the global array variable which stores all the default header image information: $_wp_default_headers. 
The rest is easy: we build a function, which we later save in functions.php of TwentyTen, to pick a random image out of the available images: 
function rotate_default_headers() {
	global  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/image-rotator-for-header-twentyten">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>The wp3 default theme TwentyTen comes with a choice of header images, which can be selected from the dashboard.<br />
To rotate these images to show randomly in the header, we can make use of the global array variable which stores all the default header image information: $_wp_default_headers. </p>
<p>The rest is easy: we build a function, which we later save in functions.php of TwentyTen, to pick a random image out of the available images: </p>
<p><code>function rotate_default_headers() {<br />
	global $_wp_default_headers;<br />
	$rnd_header = rand( 1,count($_wp_default_headers));<br />
	$header_nr = 1;<br />
	foreach( $_wp_default_headers as $heady ) :<br />
		if ( $header_nr == $rnd_header ) {<br />
		echo get_bloginfo(&#039;template_url&#039;) . substr( $heady[&#039;url&#039;], 2 );<br />
		break;<br />
		}<br />
	$header_nr++;<br />
	endforeach;<br />
}</code></p>
<p>to show the randomly rotated images in the header, add the function call in header.php &#8211;<br />
simply edit header.php, and find this line:</p>
<p><code>&lt;img src=&quot;&lt;?php header_image(); ?&gt;&quot; width=&quot;&lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;&quot; height=&quot;&lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;&quot; alt=&quot;&quot; /&gt;<br />
<!--formatted--></code><br />
expand it to accomodate the function call:</p>
<p><code>&lt;img src=&quot;&lt;?php if (function_exists(&#039;rotate_default_headers&#039;)) rotate_default_header(); else header_image(); ?&gt;&quot; width=&quot;&lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;&quot; height=&quot;&lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;&quot; alt=&quot;&quot; /&gt;<br />
<!--formatted--></code></p>
<p>done &#8211; now you will have a different header image each time you switch to a new page (within the limitions of statistics, of course).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/image-rotator-for-header-twentyten/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatically Shorten the Manual Excerpt</title>
		<link>http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt</link>
		<comments>http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt#comments</comments>
		<pubDate>Sat, 10 Jul 2010 20:54:55 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA['excerpt_length']]></category>
		<category><![CDATA['excerpt_more']]></category>
		<category><![CDATA[article short form]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[excerpt length]]></category>
		<category><![CDATA[filter hook]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[limit excerpt length]]></category>
		<category><![CDATA[manual excerpt]]></category>
		<category><![CDATA[post excerpt]]></category>
		<category><![CDATA[template file]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=898</guid>
		<description><![CDATA[When you are building or modifying a wordpress theme, you have the choice of either using &#8216;the_content()&#8217; to show the full article, or &#8216;the_excerpt()&#8217; to show a shorter version.
By default, the latter limits the output to the first 55 words of the post, and automatcally strips formatting and images.
To make things more flexible, the editor also allows you to add a manual excerpt that will have preference before the automatically generated one.
There is no default  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>When you are building or modifying a wordpress theme, you have the choice of either using &#8216;the_content()&#8217; to show the full article, or &#8216;the_excerpt()&#8217; to show a shorter version.<br />
By default, the latter limits the output to the first 55 words of the post, and automatcally strips formatting and images.<br />
To make things more flexible, the editor also allows you to add a manual excerpt that will have preference before the automatically generated one.<br />
There is no default limit to the length of this manual excerpt, which might break some carefully designed templates. </p>
<p>To apply the excerpt length limit to <strong>all excerpts</strong>, a modification of a core wordpress function &#8216;wp_trim_excerpt()&#8217; would be needed.<br />
However, changing core files is not a good idea, as the changes will be lost after each update. </p>
<p>Luckily, the same result can be achieved by using a fillter hook on &#8216;get_the_excerpt&#8217;; the code for it is added to functions.php of the theme.</p>
<p>(updated to utilize the filters &#8216;excert_length&#8217; and &#8216;excerpt_more&#8217; &#8211; aug 2010)</p>
<p><code>function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well<br />
     global $post;<br />
     if ( &#039;&#039; == $text ) {<br />
          $text = get_the_content(&#039;&#039;);<br />
          $text = apply_filters(&#039;the_content&#039;, $text);<br />
          $text = str_replace(&#039;]]&gt;&#039;, &#039;]]&amp;gt;&#039;, $text);<br />
	 }<br />
          $text = strip_shortcodes( $text ); // optional<br />
	  $text = strip_tags($text);<br />
          $excerpt_length = apply_filters('excerpt_length', 55);<br />
          $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');<br />
          $words = explode(&#039; &#039;, $text, $excerpt_length + 1);<br />
          if (count($words)&gt; $excerpt_length) {<br />
               array_pop($words);<br />
               $text = implode(' ', $words);<br />
               $text = $text . $excerpt_more;<br />
          } else {<br />
               $text = implode(' ', $words);<br />
          }<br />
     return $text;<br />
}<br />
remove_filter('get_the_excerpt', 'wp_trim_excerpt');<br />
add_filter('get_the_excerpt', 'wp_trim_all_excerpt');<br />
<!--formatted--></code></p>
<p>edit: expanded to take remove shortcode from the excerpt; 12/07/2010</p>
<p>thanks to michael.oeser for his well written article: <a href="http://www.michaeloeser.de/wie-man-wordpress-textauszuege-mit-the_excerpt-individuell-anpasst-24700.html">Wie man WordPress Textauszüge mit the_excerpt individuell anpasst</a>. It contains even  more details on how to tweak the excerpt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adsense in Content of Posts and Pages for wp3</title>
		<link>http://www.transformationpowertools.com/wordpress/adsense-in-posts-and-pages-for-wp3</link>
		<comments>http://www.transformationpowertools.com/wordpress/adsense-in-posts-and-pages-for-wp3#comments</comments>
		<pubDate>Wed, 23 Jun 2010 21:43:54 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[TwentyTen]]></category>
		<category><![CDATA[wp3]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=848</guid>
		<description><![CDATA[A flexible way to add google adsense into posts and pages in your wordpress blog.
This appraoch uses shortcodes which are an underused technique of increasing the functionality of themes.
Through the formatting options in the shortcode, the text can flow around the adsense blocks similar as it would happen with inserted images.
Options for the alignment are &#8216;left&#8217;, &#8216;center&#8217;, &#8216;right&#8217; &#8211; anything else will be treated as &#8216;none&#8217;.
The code that needs to be added to functions.php of  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/adsense-in-posts-and-pages-for-wp3">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>A flexible way to add google adsense into posts and pages in your wordpress blog.<br />
This appraoch uses shortcodes which are an underused technique of increasing the functionality of themes.<br />
Through the formatting options in the shortcode, the text can flow around the adsense blocks similar as it would happen with inserted images.<br />
Options for the alignment are &#8216;left&#8217;, &#8216;center&#8217;, &#8216;right&#8217; &#8211; anything else will be treated as &#8216;none&#8217;.</p>
<p>The code that needs to be added to functions.php of the theme is shown  below:<br />
it is called in the text with: <span style="letter-spacing: -2px; ">[ a d s e n s e &nbsp;&nbsp;&nbsp; f l o a t = &#039; l e f t &#039; ]</span><br />
<code>// allowed parameter: &#039;left&#039;, &#039;center&#039;, &#039;right&#039;, &#039;none&#039;;<br />
// other entries will be treated as &#039;none&#039;;<br />
function add_adsense($atts) {<br />
extract(shortcode_atts(array(<br />
		&#039;float&#039; =&gt; &#039;none&#039;,<br />
	), $atts));<br />
if($float == &#039;left&#039;) $float = &#039; style=&quot; float:left; margin: 10px 10px 5px 0; &quot;&#039;;<br />
elseif($float == &#039;center&#039;) $float = &#039; style=&quot; display:block; margin: 10px auto; text-align:center; &quot;&#039;;<br />
elseif($float == &#039;right&#039;) $float = &#039; style=&quot; float:right; margin: 10px 0 5px 10px; &quot;&#039;;<br />
else $float = &#039;&#039;;<br />
$ads = &#039;&lt;span class=&quot;adsense &quot;&#039;.$float.&#039;&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--<br />
google_ad_client = &quot;pub-0123412341234123&quot;;<br />
/* adsense_in_posts */<br />
google_ad_slot = &quot;1234512345&quot;;<br />
google_ad_width = 468;<br />
google_ad_height = 60;<br />
//--&gt;<br />
&lt;/script&gt;<br />
&lt;script type=&quot;text/javascript&quot;<br />
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;<br />
&lt;/script&gt;<br />
&lt;/span&gt;&#039;;<br />
return $ads;<br />
}<br />
add_shortcode(&#039;adsense&#039;, &#039;add_adsense&#039;);<!--formatted--></code></p>
<p>You can see the result here entered into a passage of &#8216;lorem ipsum&#8217;:<br />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in libero libero. Morbi porttitor, sapien et aliquam malesuada, augue elit tincidunt tortor, vel convallis orci felis quis turpis. Maecenas sit amet diam ut nibh rhoncus accumsan in eget urna. Vivamus sed tempor odio. Curabitur ultricies ultricies molestie. Maecenas eu nisl elit, vitae auctor eros. Nam quis risus libero. Nunc nec ligula sem. Nullam eget sem sed nisi porttitor imperdiet. Etiam ac sapien sed est vestibulum iaculis et id mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; <span class="adsense" style=" float:left; margin: 10px 10px 5px 0; ">
<script type="text/javascript"><!--
google_ad_client = "pub-0435302548710472";
/* personal_development */
google_ad_slot = "1575274743";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</span> Integer tortor magna, malesuada id imperdiet eu, fringilla eget sapien. Donec augue sem, semper et ultrices a, cursus eget nisl. Duis dui enim, ornare ut facilisis eget, egestas ac orci. Etiam viverra varius erat, id feugiat tellus egestas eget. </p>
<p>Aliquam sem purus, ornare ac tempor nec, accumsan ut felis. In cursus massa vitae mauris iaculis nec semper dui commodo. Proin fermentum, lacus ut accumsan scelerisque, orci dui sodales arcu, ac mollis neque odio id turpis. Mauris sagittis tincidunt ultricies. Sed diam ipsum, posuere quis scelerisque et, malesuada quis orci. Mauris nec lectus ac nibh interdum aliquet. </p>
<p>PS: <a href="http://www.tuttoaster.com/how-to-use-style-and-implement-wordpress-shortcodes/trackback">I found more examples of shortcodes in tuttoaster.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/adsense-in-posts-and-pages-for-wp3/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TwentyTen &#8211; make header image link to &#8216;home&#8217;</title>
		<link>http://www.transformationpowertools.com/wordpress/twentyten-make-header-image-link-to-home</link>
		<comments>http://www.transformationpowertools.com/wordpress/twentyten-make-header-image-link-to-home#comments</comments>
		<pubDate>Sun, 20 Jun 2010 12:03:50 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[header image link]]></category>
		<category><![CDATA[header link]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[twenty-ten]]></category>
		<category><![CDATA[wp3]]></category>
		<category><![CDATA[wp3 default theme]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=841</guid>
		<description><![CDATA[WordPress3 is out, and with it the new default theme TwentyTen.
Having the whole header image linking to the home page is one of the most common things of a theme, however this is not the standard behaviour of TwentyTen.
It is easy to remedy:
(edits are to be made in header.php of TwentyTen)
				&#60;div id=&#34;site-description&#34;&#62;&#60;?php bloginfo( &#039;description&#039; ); ?&#62;&#60;/div&#62;
&#60;a href=&#34;&#60;?php echo home_url( &#039;/&#039; ); ?&#62;&#34; title=&#34;&#60;?php echo esc_attr( get_bloginfo( &#039;name&#039;, &#039;display&#039; ) ); ?&#62;&#34; rel=&#34;home&#34;&#62;
				&#60;?php
					// Check if this  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/twentyten-make-header-image-link-to-home">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p><strong>WordPress3</strong> is out, and with it the new default theme <strong>TwentyTen</strong>.<br />
Having the whole header image linking to the home page is one of the most common things of a theme, however this is not the standard behaviour of TwentyTen.</p>
<p>It is easy to remedy:<br />
(edits are to be made in header.php of TwentyTen)</p>
<p><code>				&lt;div id=&quot;site-description&quot;&gt;&lt;?php bloginfo( &#039;description&#039; ); ?&gt;&lt;/div&gt;<br />
&lt;a href=&quot;&lt;?php echo home_url( &#039;/&#039; ); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( get_bloginfo( &#039;name&#039;, &#039;display&#039; ) ); ?&gt;&quot; rel=&quot;home&quot;&gt;<br />
				&lt;?php<br />
					// Check if this is a post or page, if it has a thumbnail, and if it&#039;s a big one<br />
.....<br />
.....<br />
					else : ?&gt;<br />
						&lt;img src=&quot;&lt;?php header_image(); ?&gt;&quot; width=&quot;&lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;&quot; height=&quot;&lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;&quot; alt=&quot;&quot; /&gt;<br />
					&lt;?php endif; ?&gt;<br />
			&lt;/a&gt;&lt;/div&gt;&lt;!-- #branding --&gt;<br />
<!--formatted--></code></p>
<p>as you can see, i added the link tag<br />
<code>&lt;a href=&quot;&lt;?php echo home_url( &#039;/&#039; ); ?&gt;&quot; title=&quot;&lt;?php echo esc_attr( get_bloginfo( &#039;name&#039;, &#039;display&#039; ) ); ?&gt;&quot; rel=&quot;home&quot;&gt;<!--formatted--></code><br />
just after this line<br />
<code>&lt;div id=&quot;site-description&quot;&gt;&lt;?php bloginfo( &#039;description&#039; ); ?&gt;&lt;/div&gt;<!--formatted--></code><br />
and closed it before the end of the #branding div<br />
<code>&lt;/a&gt;&lt;/div&gt;&lt;!-- #branding --&gt;<!--formatted--></code></p>
<p>that is all.<br />
enjoy your new wordpress setup with this familiar functionalty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/twentyten-make-header-image-link-to-home/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Advanced styling of the prev/next post links</title>
		<link>http://www.transformationpowertools.com/wordpress/advanced-styling-of-the-prev-next-post-links</link>
		<comments>http://www.transformationpowertools.com/wordpress/advanced-styling-of-the-prev-next-post-links#comments</comments>
		<pubDate>Wed, 09 Jun 2010 09:22:02 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[adjacent post]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[next]]></category>
		<category><![CDATA[prev/next post]]></category>
		<category><![CDATA[previous]]></category>
		<category><![CDATA[single]]></category>
		<category><![CDATA[styling]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=815</guid>
		<description><![CDATA[when you use the &#8216;previous/next post&#8217; navigation in single posts, you will have noticed that these links appear empty when there is no previous or next post, as for the latest and the first article.
to keep your page design and to style these occurences by showing a special image or text, you can make use of the virtually undocumented wordpress function &#8216;get_adjacent_post()&#8217;.
see this screenshot of the navigation in a single post page:

the example below is  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/advanced-styling-of-the-prev-next-post-links">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>when you use the &#8216;<a href="http://codex.wordpress.org/Template_Tags/previous_post_link">previous</a>/<a href="http://codex.wordpress.org/Template_Tags/next_post_link">next</a> post&#8217; navigation in single posts, you will have noticed that these links appear empty when there is no previous or next post, as for the latest and the first article.</p>
<p>to keep your page design and to style these occurences by showing a special image or text, you can make use of the virtually undocumented wordpress function <a href="http://phpxref.ftwr.co.uk/wordpress/wp-includes/link-template.php.source.html#l989">&#8216;get_adjacent_post()&#8217;</a>.</p>
<p>see this screenshot of the navigation in a single post page:</p>
<p><img src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2010/06/prev_next_link-512x62.png" alt="prev_next_link" title="prev_next_link" width="512" height="62" class="aligncenter size-large wp-image-816" /></p>
<p>the example below is done for the default theme, and will show a greyed-out text in the place of the links.</p>
<p><code>&lt;div class=&quot;navigation&quot;&gt;<br />
	&lt;div class=&quot;alignleft&quot;&gt;<br />
	&lt;?php if(get_adjacent_post(false, &#039;&#039;, true)) {  echo &#039;Previous older article: &#039;; previous_post_link(&#039;%link&#039;);   }<br />
 else { echo &#039;&lt;span style=&quot;color:#bbb;&quot;&gt;&quot;&#039;.get_the_title().&#039;&quot; is the oldest post, no further articles. &lt;/span&gt;&#039;; } ; ?&gt;<br />
 &lt;/div&gt;<br />
	&lt;div class=&quot;alignright&quot;&gt;<br />
	&lt;?php if(get_adjacent_post(false, &#039;&#039;, false)) {  echo &#039;Next newer article: &#039;; next_post_link(&#039;%link&#039;); }<br />
 else { echo &#039;&lt;span style=&quot;color:#bbb;&quot;&gt;&quot;&#039;.get_the_title().&#039;&quot; is the latest post: no newer articles. &lt;/span&gt;&#039;; } ; ?&gt;<br />
	&lt;/div&gt;<br />
&lt;/div&gt;<br />
<!--formatted--></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/advanced-styling-of-the-prev-next-post-links/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Defining the writing area of the dashboard editor</title>
		<link>http://www.transformationpowertools.com/wordpress/defining-the-writing-area-of-the-dashboard-editor</link>
		<comments>http://www.transformationpowertools.com/wordpress/defining-the-writing-area-of-the-dashboard-editor#comments</comments>
		<pubDate>Tue, 18 May 2010 15:44:19 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[action hook]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[tinyMCE]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[widescreen]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=780</guid>
		<description><![CDATA[the first of my upcoming &#8216;tips and tricks&#8217; &#8211; a handy function to style the editor area of your self-hosted wordpress blog or cms:
if you are working on a modern widescreen monitor, but want to restrict the wordpress editor area (your writing paper, so to speak) to the width as it will later show in your blog, here is a tip what to add to functions.php of your theme:
function custom_max_width_editor() {
echo &#039;&#60;style type=&#34;text/css&#34;&#62; textarea#content, #content_ifr  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/defining-the-writing-area-of-the-dashboard-editor">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>the first of my upcoming &#8216;tips and tricks&#8217; &#8211; a handy function to style the editor area of your self-hosted wordpress blog or cms:<br />
if you are working on a modern widescreen monitor, but want to restrict the wordpress editor area (your writing paper, so to speak) to the width as it will later show in your blog, here is a tip what to add to functions.php of your theme:</p>
<p><code>function custom_max_width_editor() {<br />
echo &#039;&lt;style type=&quot;text/css&quot;&gt; textarea#content, #content_ifr {<br />
max-width:580px;<br />
min-height:400px;<br />
border-right: 1px solid #ddd; }&lt;/style&gt;&#039;;<br />
}<br />
add_action(&#039;admin_head&#039;, &#039;custom_max_width_editor&#039;);<br />
<!--formatted--></code></p>
<p>the &#8216;min-height&#8217; is optional, and will give you a larger writing area to start with.<br />
and the border shows clearly how wide the defined writing area is.<br />
adjust the number values, and enjoy the next level of control over your wordpress.</p>
<p>you might even want to add the predominant background-color of your blog&#8217;s content area &#8230;</p>
<p>ps:<br />
a big thank you to @Purren from the wordpress support forum, who submitted a correction to make it also work for the visual editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/defining-the-writing-area-of-the-dashboard-editor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight the post&#8217;s categories in the category list</title>
		<link>http://www.transformationpowertools.com/wordpress/highlight-post-categories-function</link>
		<comments>http://www.transformationpowertools.com/wordpress/highlight-post-categories-function#comments</comments>
		<pubDate>Mon, 17 May 2010 22:05:04 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[category list]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[post categories]]></category>
		<category><![CDATA[single post]]></category>
		<category><![CDATA[wp_list_categories]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=768</guid>
		<description><![CDATA[highlighting the categories of a post in single post view is a useful trick to allow the viewer to find related posts.
there are plugins available which extend the functionality of the standard category widget to do this.
sometimes, however, it can be desirable to have the same feature with a function that you can use like you would use &#8216;wp_list_categories();&#8217; &#8211; exactly with the same arguments.
/* hi_list_categories() to highlight the current categories of a post in  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/highlight-post-categories-function">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>highlighting the categories of a post in single post view is a useful trick to allow the viewer to find related posts.</p>
<p>there are plugins available which extend the functionality of the standard category widget to do this.</p>
<p>sometimes, however, it can be desirable to have the same feature with a function that you can use like you would use &#8216;wp_list_categories();&#8217; &#8211; exactly with the same arguments.</p>
<p><code>/* hi_list_categories() to highlight the current categories of a post in single.php;<br />
uses the arguments in the same way as wp_list_categories();<br />
alchymyth 2010 / www.transformationpowertools.com/wordpress */<br />
function hi_list_categories($args) {<br />
//following section is extracted from http://phpxref.com/xref/wordpress/wp-includes/category-template.php.source.html#l389<br />
$defaults = array(<br />
   &#039;show_option_all&#039; =&gt; &#039;&#039;,<br />
   &#039;orderby&#039; =&gt; &#039;name&#039;,<br />
   &#039;order&#039; =&gt; &#039;ASC&#039;,<br />
   &#039;show_last_update&#039; =&gt; 0,<br />
   &#039;style&#039; =&gt; &#039;list&#039;,<br />
   &#039;show_count&#039; =&gt; 0,<br />
   &#039;hide_empty&#039; =&gt; 1,<br />
   &#039;use_desc_for_title&#039; =&gt; 1,<br />
   &#039;child_of&#039; =&gt; 0,<br />
   &#039;feed&#039; =&gt; &#039;&#039;,<br />
   &#039;feed_type&#039; =&gt; &#039;&#039;,<br />
   &#039;feed_image&#039; =&gt; &#039;&#039;,<br />
   &#039;exclude&#039; =&gt; &#039;&#039;,<br />
   &#039;exclude_tree&#039; =&gt; &#039;&#039;,<br />
   &#039;current_category&#039; =&gt; 0,<br />
   &#039;hierarchical&#039; =&gt; true,<br />
   &#039;title_li&#039; =&gt; __( &#039;Categories&#039; ),<br />
   &#039;echo&#039; =&gt; 1,<br />
   &#039;depth&#039; =&gt; 0<br />
  );<br />
       $r = wp_parse_args( $args, $defaults );<br />
       if ( !isset( $r[&#039;pad_counts&#039;] ) &amp;&amp; $r[&#039;show_count&#039;] &amp;&amp; $r[&#039;hierarchical&#039;] ) {<br />
           $r[&#039;pad_counts&#039;] = true;<br />
       }<br />
       if ( isset( $r[&#039;show_date&#039;] ) ) {<br />
           $r[&#039;include_last_update_time&#039;] = $r[&#039;show_date&#039;];<br />
       }<br />
	   if ( isset( $r[&#039;echo&#039;] ) ) {<br />
           $echo_or_return = $r[&#039;echo&#039;];<br />
       } ;  $r[&#039;echo&#039;] = 0;<br />
       if ( true == $r[&#039;hierarchical&#039;] ) {<br />
           $r[&#039;exclude_tree&#039;] = $r[&#039;exclude&#039;];<br />
           $r[&#039;exclude&#039;] = &#039;&#039;;<br />
       }<br />
       extract( $r );<br />
//end of extracted code<br />
global $post;<br />
// highlighting only for single post view<br />
if(is_single()) :<br />
$categories = wp_get_post_categories($post-&gt;ID);<br />
foreach ($categories as $catid) {<br />
$cat = get_category($catid);<br />
$cats[] = $cat-&gt;cat_ID;<br />
 }<br />
$cats_list =  wp_list_categories( $r );<br />
foreach($cats as $value) {<br />
	if(preg_match(&#039;#-item-&#039; . $value . &#039;&quot;&gt;#&#039;, $cats_list)) {<br />
	$cats_list = str_replace(&#039;item-&#039; . $value . &#039;&quot;&gt;&#039;, &#039;item-&#039; . $value . &#039; current-cat&quot;&gt;&#039;, $cats_list);<br />
	}<br />
	}<br />
if($echo_or_return == 1) { echo $cats_list; }<br />
else { return $cats_list; } ;<br />
else :<br />
//use default category list if not single post view<br />
wp_list_categories( $args );<br />
endif;<br />
} //end of function hi_list_categories();<!--formatted--></code></p>
<p>in the same way, as you would have used &#8216;wp_list_categories();&#8217; you can now use &#8216;hi_list_categories();&#8217; which will add the class &#8216;.current-cat&#8217; to each of the categories of the post in single post view.</p>
<p>ps:<br />
viewing this article made me aware of the restricted functionality of the &#8216;code&#8217; plugin which does not allow empty lines and text indents &#8211; if anyone of you knows of a great code plugin, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/highlight-post-categories-function/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Playing with columns &#8211; stacking posts in a grid</title>
		<link>http://www.transformationpowertools.com/wordpress/playing-with-columns-stacking-posts-grid-style</link>
		<comments>http://www.transformationpowertools.com/wordpress/playing-with-columns-stacking-posts-grid-style#comments</comments>
		<pubDate>Sun, 11 Apr 2010 22:26:22 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[automatic arrangement]]></category>
		<category><![CDATA[custom template]]></category>
		<category><![CDATA[flexible columns]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[grid layout]]></category>
		<category><![CDATA[grid style]]></category>
		<category><![CDATA[multi columns]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[thumbnail grid]]></category>
		<category><![CDATA[wordpress the]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=750</guid>
		<description><![CDATA[a different approach to &#8216;grid style&#8217; &#8211; stacking the posts in a tightly ordered grid; to get a similar design as in http://www.creativedepart.com/ &#8211; ideal to use with thumbnails and excerpts:
(bare minimum code, without explanation, totally flexible and automatic)
&#60;?php $num_cols = 4; // set the number of columns here
$paged = (get_query_var(&#039;paged&#039;)) ? get_query_var(&#039;paged&#039;) : 1; // for pagination
$args = array(
&#039;posts_per_page&#039; =&#62; 16, // optional to overwrite the dashboard setting
&#039;cat&#039; =&#62; 0, // add any other  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/playing-with-columns-stacking-posts-grid-style">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p>a different approach to &#8216;grid style&#8217; &#8211; stacking the posts in a tightly ordered grid; to get a similar design as in http://www.creativedepart.com/ &#8211; ideal to use with thumbnails and excerpts:<br />
(bare minimum code, without explanation, totally flexible and automatic)</p>
<p><code>&lt;?php $num_cols = 4; // set the number of columns here<br />
$paged = (get_query_var(&#039;paged&#039;)) ? get_query_var(&#039;paged&#039;) : 1; // for pagination<br />
$args = array(<br />
&#039;posts_per_page&#039; =&gt; 16, // optional to overwrite the dashboard setting<br />
&#039;cat&#039; =&gt; 0, // add any other query parameter to this array<br />
&#039;paged&#039; =&gt; $paged<br />
); query_posts($args);<br />
if (have_posts()) :<br />
  for ( $i=1 ; $i &lt;= $num_cols; $i++ ) :<br />
  echo &#039;&lt;div id=&quot;col&quot;&gt;&#039;;<br />
  $counter = $num_cols + 1 - $i;<br />
    while (have_posts()) : the_post();<br />
    if( $counter%$num_cols == 0 ) : ?&gt;<br />
    &lt;!-- core post area;<br />
    title, content, thumbnails, postmeta, etc --&gt;<br />
    &lt;?php endif; $counter++;<br />
    endwhile;<br />
    rewind_posts();<br />
  echo &#039;&lt;/div&gt;&#039;; //closes the column div<br />
  endfor;<br />
next_posts_link(&#039;&amp;laquo; Older Entries&#039;);<br />
previous_posts_link(&#039;Newer Entries &amp;raquo;&#039;);<br />
else:<br />
  echo &#039;no posts&#039;;<br />
endif; wp_reset_query(); ?&gt;<!--formatted--></code><br />
minimum css:<br />
<code>.col { width:150px; float:left; margin-right:5px; }</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/playing-with-columns-stacking-posts-grid-style/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Continuous post numbers for your blog</title>
		<link>http://www.transformationpowertools.com/wordpress/continuous-post-numbers</link>
		<comments>http://www.transformationpowertools.com/wordpress/continuous-post-numbers#comments</comments>
		<pubDate>Sat, 27 Mar 2010 11:31:22 +0000</pubDate>
		<dc:creator>alchymyth</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[action hook]]></category>
		<category><![CDATA[continous number]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[post number]]></category>

		<guid isPermaLink="false">http://www.transformationpowertools.com/wordpress/?p=730</guid>
		<description><![CDATA[if you look at my blog, you may notice that all posts are numbered with a unique number &#8211; starting with 1 for the oldest post and increasing continuous for each published post.
how is it done?
with a function that is hooked to some wordpress core actions: 
function updateNumbers() {
/* numbering the published posts: preparation: create an array with the ID in sequence of publication date, /
/ save the number in custom field &#039;incr_number&#039; of post  ... &#187; <small><a href="http://www.transformationpowertools.com/wordpress/continuous-post-numbers">read more</a></small> &#187;]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.transformationpowertools.com/wordpress/wp-content/uploads/2010/03/post_numbers-300x266.jpg" alt="post_numbers" title="post_numbers" width="300" height="266" class="alignright size-medium wp-image-737" />if you look at my blog, you may notice that all posts are numbered with a unique number &#8211; starting with 1 for the oldest post and increasing continuous for each published post.</p>
<p>how is it done?</p>
<p>with a function that is hooked to some wordpress core actions: </p>
<p><code>function updateNumbers() {<br />
/* numbering the published posts: preparation: create an array with the ID in sequence of publication date, /<br />
/ save the number in custom field &#039;incr_number&#039; of post with ID  /<br />
/ to show in post (within the loop) use &lt;?php echo get_post_meta($post-&gt;ID,&#039;incr_number&#039;,true); ?&gt;<br />
/ alchymyth 2010 */<br />
global $wpdb;<br />
$querystr = &quot;SELECT $wpdb-&gt;posts.* FROM $wpdb-&gt;posts WHERE $wpdb-&gt;posts.post_status = &#039;publish&#039; AND $wpdb-&gt;posts.post_type = &#039;post&#039; &quot;;<br />
$pageposts = $wpdb-&gt;get_results($querystr, OBJECT);<br />
$counts = 0 ;<br />
if ($pageposts):<br />
foreach ($pageposts as $post):<br />
setup_postdata($post);<br />
$counts++;<br />
add_post_meta($post-&gt;ID, &#039;incr_number&#039;, $counts, true);<br />
update_post_meta($post-&gt;ID, &#039;incr_number&#039;, $counts);<br />
endforeach;<br />
endif;<br />
}<br />
add_action ( &#039;publish_post&#039;, &#039;updateNumbers&#039; );<br />
add_action ( &#039;deleted_post&#039;, &#039;updateNumbers&#039; );<br />
add_action ( &#039;edit_post&#039;, &#039;updateNumbers&#039; );<!--formatted--></code></p>
<p>save it to functions.php of your wordpress theme.</p>
<p>the function takes care of everything:</p>
<ul>
<li>gets a list of all published posts</li>
<li>counts through the posts</li>
<li>adds or updates the custom field</li>
</ul>
<p>anywhere you want to display this post number, use the following line:<br />
<code>&lt;?php echo get_post_meta($post-&gt;ID,&#039;incr_number&#039;,true); ?&gt; <!--formatted--></code></p>
<p>just be aware that these numbers are not unique numbers &#8216;for life&#8217; as they will be reallocated when you delete a post, or when you change the post order by changing the publish date.</p>
<p>Remark:<br />
to trigger the function to generate the custom fields and fill them with the numbers, you need at least to make a new post, edit one post, or delete one post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.transformationpowertools.com/wordpress/continuous-post-numbers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
