<?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>matty.co.za &#187; WordPress</title>
	<atom:link href="http://matty.co.za/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://matty.co.za</link>
	<description>Web developer, WordPress enthusiast, avid musician and blogger</description>
	<lastBuildDate>Thu, 12 Apr 2012 08:43:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Filtering the Options API in WordPress</title>
		<link>http://matty.co.za/2012/01/filtering-wordpress-options-api/</link>
		<comments>http://matty.co.za/2012/01/filtering-wordpress-options-api/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 09:00:13 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1228</guid>
		<description><![CDATA[The Options API in WordPress is one of the many WordPress APIs we all use every day when developing with WordPress. A quick call to get_option() is not an uncommon sight. What if you could dynamically filter those options? You can. Adding filters in WordPress is also a common practice. Combining this with the Options [...]]]></description>
			<content:encoded><![CDATA[<p>The Options API in WordPress is one of the many WordPress APIs we all use every day when developing with WordPress. A quick call to get_option() is not an uncommon sight. What if you could dynamically filter those options? <strong>You can</strong>.</p>
<p>Adding filters in WordPress is also a common practice. Combining this with the Options API can allow for, for example, the ability to change an option when in preview mode without committing to the change.</p>
<p>In the &#8220;Magazine&#8221; template in Canvas by WooThemes, for example, WooTumblog &#8220;image&#8221; and &#8220;video&#8221; posts are aware when they are present in the magazine-style grid. This is an example of filtering the Options API.</p>
<p><span id="more-1228"></span><br />
<h3>How do I use this?</h3>
<p>Filtering the Options API is as easy as compiling any other filter. The filter hook is as follows: &#8220;<code>option_optionname</code>&#8221; (replace &#8220;<code>optionname</code>&#8221; with the name of the option you want to filter).</p>
<h3>That filter is applied after the database lookup. What about before that even happens?</h3>
<p>It is possible to short-circuit an option&#8217;s value using a second filter that has been made available. This means it&#8217;s possible to set a custom value, via a filter, for an option, bypassing the database lookup. My thoughts are packed with ideas for where to use this filter!</p>
<p>To short-circuit an option called, for example, &#8220;testoption&#8221;, you&#8217;d add the following code to your <code>functions.php</code> file:</p>
<p><code></p>
<pre>
add_filter( 'pre_option_testoption', 'matty_shortcircuit_options' );

function matty_shortcircuit_options ( $default ) {
	$value = 'this is a short-circuited option';
	return $value;
} // End matty_shortcircuit_options()
</pre>
<p></code></p>
<p>Using the &#8220;testoption&#8221; example again, this is how you&#8217;d override the value after it&#8217;s been retrieved from the database:</p>
<p><code></p>
<pre>
add_filter( 'option_testoption', 'matty_override_options' );

function matty_override_options ( $value ) {
	$value = 'this is an overridden option';

	// To override based on a condition, do this.
	if ( $value == 'test' ) {
		$value = 'this is an overridden option, based on a condition.';
	}

	return $value;
} // End matty_override_options()
</pre>
<p></code></p>
<p>This is just, however, a starting point as to how to do this. The possibilities are virtually limitless as to what is possible here and how to apply this in your projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/filtering-wordpress-options-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-thinking the concept of the &#8220;impossible&#8221;</title>
		<link>http://matty.co.za/2012/01/re-thinking-the-impossible/</link>
		<comments>http://matty.co.za/2012/01/re-thinking-the-impossible/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 17:00:14 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1213</guid>
		<description><![CDATA[In today&#8217;s society, it seems to be a common occurrence to use the word &#8220;impossible&#8221;. For example, after climbing a mountain, one might say something like; &#8220;wow, that was impossible&#8221;. No it wasn&#8217;t&#8230; you just did it. Nowadays we seem to have a tendency to over-exaggerate (pardon the tautology there) and, in many cases, start to believe what [...]]]></description>
			<content:encoded><![CDATA[<p>In today&#8217;s society, it seems to be a common occurrence to use the word &#8220;impossible&#8221;. For example, after climbing a mountain, one might say something like; &#8220;wow, that was impossible&#8221;. No it wasn&#8217;t&#8230; you just did it. Nowadays we seem to have a tendency to over-exaggerate (pardon the tautology there) and, in many cases, start to believe what we&#8217;re saying. Surely, this affects how we approach tasks and situations. Why should it?</p>
<p>Over the past few years (I&#8217;d say, since about 2008), I&#8217;ve decided to approach tasks day to day from a different angle. How can we say that a task is &#8220;impossible&#8221; if we haven&#8217;t even yet attempted it?</p>
<p>This is quite a common occurrence in web development&#8230; developers looking at a task, attempting to analyze it, getting &#8220;stuck&#8221; at one point and then moving on, deeming it &#8220;impossible&#8221;. Why does it have to, all of a sudden, be &#8220;impossible&#8221;, if you haven&#8217;t even attempted it yet? Why settle for the &#8220;shortcut&#8221; when you could just sit down and develop it how you envision it in the first place?</p>
<p><span id="more-1213"></span>It&#8217;s not about it being &#8220;impossible&#8221;&#8230; you just haven&#8217;t found the correct pieces yet, or how they fit together.</p>
<p>As a small example to illustrate how this approach sucks and how it could be improved with a simple re-thinking process, lets take a look at a real-world scenario I experienced last year.</p>
<p>During the development of our &#8220;Editorial&#8221; theme at WooThemes, we wanted to add functionality to provide the administrator with more control over how many columns their content should be laid out in. This, at first glance, seems quite straight forward. A simple PHP script to cut and re-arrange the words at certain points would do this.</p>
<p>What if the author wants to control where the content is cut off? What if they want virtually infinite possible columns? Well, a shortcode would do this, right?</p>
<p>What if they switch themes? Their content would look ugly and be riddled with a bunch of shortcodes that aren&#8217;t in use anymore. In a context like this, where the content is everything, we couldn&#8217;t have that.</p>
<p>This is where we got down to the drawing board and found the solution that stands to date. A simple button that adds an HTML comment into the author&#8217;s content. We then use a WordPress filter (and regular expression) to convert the HTML comments into semantic HTML tags on the frontend, keeping count of how many columns are being generated and adjusting the layout accordingly. If the administrator decides to switch themes, the HTML comments won&#8217;t affect the display of the content, nor the functionality of the WordPress admin. The button itself, as well as how the HTML comments are displayed in the WordPress admin, echoes how WordPress itself handles similar functionality, integrating seamlessly into the authoring experience.</p>
<p>To illustrate how this relates to the &#8220;impossible&#8221;, many would settle for the shortcode option, as it is the most direct and &#8220;obvious&#8221; choice, without taking into account the ramifications thereof.</p>
<p>We&#8217;ve taken this same approach on many other pieces of functionality within themes and functionality developed at WooThemes. I&#8217;ve made this concept a part of my day to day approach to things as well.</p>
<p>To sum it up in a sentence, I&#8217;d say, &#8220;don&#8217;t assume something is &#8216;impossible&#8217; until you&#8217;ve tried it. You never know&#8230; you may just get a better result&#8221;. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/re-thinking-the-impossible/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GROW BootCamp 2012 &#8211; The Creations</title>
		<link>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/</link>
		<comments>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 14:00:13 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1204</guid>
		<description><![CDATA[At the GROW Academy 2012, Jeff and I have been discussing and showcasing WordPress and what it can do. We&#8217;ve been working with the recruits, setting up WordPress.com websites and learning the system. We thought it&#8217;d be a cool idea to showcase what the recruits of 2012 have compiled. Check out what the 2012 recruits [...]]]></description>
			<content:encoded><![CDATA[<p>At the GROW Academy 2012, Jeff and I have been discussing and showcasing WordPress and what it can do. We&#8217;ve been working with the recruits, setting up WordPress.com websites and learning the system.</p>
<p>We thought it&#8217;d be a cool idea to showcase what the recruits of 2012 have compiled.</p>
<p><span id="more-1204"></span>Check out what the 2012 recruits put together:</p>
<ul>
<li><a href="http://mtricam.wordpress.com/" target="_blank">mtricam</a></li>
<li><a href="http://genevievedavids.wordpress.com/" target="_blank">genevievedavids</a></li>
<li><a href="http://augustinemutale.wordpress.com/" target="_blank">augustinemutale</a></li>
<li><a href="http://margofortune.wordpress.com/" target="_blank">margofortune</a></li>
<li><a href="http://suzannesmith42.wordpress.com/" target="_blank">suzannesmith42</a></li>
<li><a href="http://justinejooste.wordpress.com/" target="_blank">justinejooste</a></li>
<li><a href="http://ricardoglittle.wordpress.com/" target="_blank">ricardoglittle</a></li>
<li><a href="http://thembil.wordpress.com/" target="_blank">thembil</a></li>
<li><a href="http://nathanieldicks.wordpress.com/" target="_blank">nathanieldicks</a></li>
<li><a href="http://gershwin21.wordpress.com/" target="_blank">gershwin21</a></li>
<li><a href="http://cyrilmphanga.wordpress.com/" target="_blank">cyrilmphanga</a></li>
</ul>
<p>Pretty cool, right? <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>These are the slides from yesterday&#8217;s presentation at the GROW Academy. Share your thoughts in the comments below.</p>
<p><iframe src="http://app.sliderocket.com:80/app/fullplayer.aspx?id=427F49A6-F53B-3D2B-6078-C27F074A00C1" width="550" height="439" scrolling=no frameBorder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/grow-bootcamp-2012-creations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GROW Academy Bootcamp 2012</title>
		<link>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/</link>
		<comments>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:00:31 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1198</guid>
		<description><![CDATA[This week, Jeff and I will be presenting at our second GROW Academy Bootcamp session. We&#8217;ll be discussing &#8220;Website Design &#38; Development&#8221; with the recruits, running through WordPress and how to setup a website using WordPress.com or WordPress.org. The GROW Academy is an initiative to educate and empower the youth of today through technology. The [...]]]></description>
			<content:encoded><![CDATA[<p>This week, <a title="Jeffikus" href="http://jeffikus.com/">Jeff</a> and I will be presenting at our second GROW Academy Bootcamp session. We&#8217;ll be discussing &#8220;Website Design &amp; Development&#8221; with the recruits, running through WordPress and how to setup a website using WordPress.com or WordPress.org.</p>
<p>The <a title="The GROW Academy" href="http://grow.org.za/">GROW Academy</a> is an initiative to educate and empower the youth of today through technology. The Bootcamp session covers everything from social media and setting up e-mail, all the way through to search engine optimisation and an internet super-user course, for those who wish to continue on with more advanced studies. The GROW website&#8217;s &#8220;<a title="About GROW" href="http://grow.org.za/about/">About</a>&#8221; page (built on Canvas and Canvas BuddyPress by WooThemes) has a detailed explanation of the initiative and it&#8217;s founding partners.</p>
<p><span id="more-1198"></span>This year, Jeff and I will be making some exciting additions to our presentation. While code, to some, can seem dry and boring, I can assure you that there&#8217;s nothing dry or boring about our presentation. We had such a blast at last year&#8217;s Bootcamp and are really looking forward to getting into some code with this year&#8217;s recruits.</p>
<p>If you&#8217;re keen to get involved with GROW, I&#8217;d encourage you to contact the GROW Academy and see how you can help out.</p>
<p>Remember: it&#8217;s all easy, and there&#8217;s no such thing as a stupid question. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/grow-academy-bootcamp-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Guide to the WordPress Transients API</title>
		<link>http://matty.co.za/2012/01/wordpress-transients-api/</link>
		<comments>http://matty.co.za/2012/01/wordpress-transients-api/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 08:00:38 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1168</guid>
		<description><![CDATA[The Transient API in WordPress is one of the many APIs available in the WordPress core that, once used, become invaluable and used on a daily basis. This is a quick guide to getting started with the transients API, when to use it and why. The Transients API, while similar to the WordPress options API, [...]]]></description>
			<content:encoded><![CDATA[<p>The Transient API in WordPress is one of the many APIs available in the WordPress core that, once used, become invaluable and used on a daily basis. This is a quick guide to getting started with the transients API, when to use it and why.</p>
<p>The Transients API, while similar to the WordPress options API, has the addition of an expiry time. The API is used to store data in the database for a fix amount of time, at which point it is deleted and would need to be re-added, if one requires the data again. The WordPress Codex explains the <a href="http://codex.wordpress.org/Transients_API" title="The Transients API documentation on the WordPress Codex">Transients API</a> as:</p>
<blockquote><p>…very similar to the Options API but with the added feature of an expiration time, which simplifies the process of using the wp_options database table to store cached information.</p></blockquote>
<p>From a technical standpoint, transients are also sped up by caching plugins, which store the data in memory, rather than in the database, making for a faster lookup.</p>
<p><span id="more-1168"></span><br />
<h3>Getting started</h3>
<p>Using transients is easier than you might think. The first thing to note is that there are two types of transients; conventional (only on the specified site within a WordPress multisite installation) and &#8220;site&#8221; (across the entire WordPress multisite installation). They interact in the same way though.</p>
<p>The Transients API has 3 core functions; <code>set_transient()</code>, <code>get_transient()</code> and <code>delete_transient()</code>. They function in the same way as <code>add_option()</code>, <code>get_option()</code> and <code>delete_option()</code> do, so they should be familiar.</p>
<h3>Brief function analysis</h3>
<h4>set_transient()</h4>
<p>Stores data in a transient.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient to store the data in)</li>
<li>The value (the data to store)</li>
<li>The expiration (the time expiration, in seconds, from the time of storage &#8211; one day would be 60 * 60 * 24)</li>
</ol>
<h4>get_transient()</h4>
<p>Retrieve the transient data, if it&#8217;s available.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient the data is stored in)</li>
</ol>
<h4>delete_transient()</h4>
<p>Force the expiry/removal of a specified transient.</p>
<p>The parameters are:</p>
<ol>
<li>The transient key (the name of the transient the data is stored in)</li>
</ol>
<h3>The Transients API in use</h3>
<p>To use the Transients API, the process is straight forward. Check if the transient is available. If it isn&#8217;t, get the data (this could be anything from a simple line of text -which may not be too practical- to an advanced and resource-intensive database query, which you may not want to run every time your website is loaded) and assign it to the transient. Assign the data to a variable and return it for use in your code.</p>
<p>In code, this may look like the following:</p>
<p><code></p>
<pre>
&lt;?php
	$transient_key = 'my-transient-key';
	$data = get_transient( $transient_key );
	if ( $data == '' ) {
		$data = get_posts( array( 'posts_per_page' => -1 ) );
		set_transient( $transient_key, $data, 60 * 60 * 24 );
	}

	// You would then carry on using $data in your code.
?&gt;
</pre>
<p></code></p>
<p>An example of when WordPress itself uses the Transients API is during checks for updates of themes, plugins and WordPress itself. These checks don&#8217;t in fact happen each time you visit the &#8220;Updates&#8221; dashboard screen, but periodically based on a transient of stored information about the themes and plugins you have in your installation.</p>
<h3>Where and when to use the Transients API</h3>
<p>Usage of this API is vast and varied. Essentially, the Transients API can be seen as a form of caching system with an expiry time. Therefore, you may want to cache data (for example, from an RSS feed or API request) for a few hours or days, or you could cache something for a few seconds while a user is busy on your website (to make their experience that little bit faster). With such simple implementation, the usage possibilities are limited only by one&#8217;s imagination and a coding project&#8217;s requirements.</p>
<p>Now that you know about the Transients API, I&#8217;m certain you&#8217;ll start using it more often to speed up your projects. This API, while seemingly so small and simple, is incredibly powerful and can transform bloated code into streamlined genius.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/wordpress-transients-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Re-thinking &#8220;Uncategorized&#8221; in WordPress</title>
		<link>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/</link>
		<comments>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:00:30 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Web Developer]]></category>
		<category><![CDATA[WordPress Support]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1158</guid>
		<description><![CDATA[As WordPress users soon come to realise after setting up their website, a few defaults are loaded in. These defaults include a test &#8220;Hello World&#8221; post with a comment from Mr. WordPress, a &#8220;Sample Page&#8217; with some text and instructions and the &#8220;Uncategorized&#8221; category, amongst the various default &#8220;Links&#8221; data and &#8220;Blogroll&#8221; category. Having given [...]]]></description>
			<content:encoded><![CDATA[<p>As WordPress users soon come to realise after setting up their website, a few defaults are loaded in. These defaults include a test &#8220;Hello World&#8221; post with a comment from Mr. WordPress, a &#8220;Sample Page&#8217; with some text and instructions and the &#8220;Uncategorized&#8221; category, amongst the various default &#8220;Links&#8221; data and &#8220;Blogroll&#8221; category.</p>
<p>Having given this some thought, the &#8220;Uncategorized&#8221; category doesn&#8217;t really seem correct in that the term is a category in itself. It&#8217;s almost a full paradox to say that a post is &#8220;uncategorized&#8221;, meanwhile it is in fact in a category.</p>
<p><span id="more-1158"></span></p>
<p>Upon removing the relationship entirely between the &#8220;Uncategorized&#8221; category and a specific post, the post worked as expected with no issues. By default, a post is assigned to the category set as the default category in the WordPress settings screens within the WordPress admin. Therefore, while it is possible to assign a new default category and delete the &#8220;Uncategorized&#8221; category, the question is more, <strong>why do posts in WordPress need to be assigned to a specific category?</strong> Can they not just float independently?</p>
<p>I&#8217;m sure there&#8217;s a reason behind this (if you know it or can offer some insight into possible reasons, please share)&#8230; just thought I&#8217;d pose the thought and see what you all think. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/re-thinking-uncategorized-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Matty Theme QuickSwitch featured on The Sweet Plugin of the Day</title>
		<link>http://matty.co.za/2012/01/theme-quickswitch-on-the-sweet-plugin/</link>
		<comments>http://matty.co.za/2012/01/theme-quickswitch-on-the-sweet-plugin/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 08:00:51 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Project 365]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1140</guid>
		<description><![CDATA[One thing I enjoy almost as much as developing with WordPress is reading about WordPress development and the goings-on within the WordPress community. WPCandy, a website I&#8217;ve written a few posts for, is my main go-to resource for community news and current happenings within the WordPress community. Ryan, the editor at WPCandy, broadcasts a video [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I enjoy almost as much as developing with WordPress is reading about WordPress development and the goings-on within the WordPress community. <a title="WPCandy" href="http://wpcandy.com/">WPCandy</a>, a website I&#8217;ve written a few posts for, is my main go-to resource for community news and current happenings within the WordPress community.</p>
<p>Ryan, the editor at WPCandy, broadcasts a video podcast called &#8220;The Sweet Plugin of the Day&#8221;, where he reviews a plugin that he finds useful and/or interesting. <a title="Matty Theme QuickSwitch" href="http://matty.co.za/plugins/matty-theme-quickswitch/">Matty Theme QuickSwitch</a>, a plugin I recently released to make quick switching between WordPress themes easier, was recently featured on &#8220;The Sweet Plugin&#8221;.</p>
<p><span id="more-1140"></span><br />
<iframe src="http://player.vimeo.com/video/34124084?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="549" height="309"></iframe></p>
<p>Thanks for the great review and kind words, Ryan. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Click to read the <a title="The text-based review of Matty Theme QuickSwitch on WPCandy" href="http://wpcandy.com/category/broadcasts/the-sweet-plugin">full text-based review of Matty Theme QuickSwitch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2012/01/theme-quickswitch-on-the-sweet-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More tips for styling the WordPress tinyMCE editor</title>
		<link>http://matty.co.za/2010/08/more-wordpress-custom-editor-styles/</link>
		<comments>http://matty.co.za/2010/08/more-wordpress-custom-editor-styles/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:11:07 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Theming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[WordPress Support]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1084</guid>
		<description><![CDATA[A few weeks ago, I blogged about styling the tinyMCE editor in WordPress to resemble your WordPress theme&#8217;s content area. On this post, I received a comment from LA, asking if it&#8217;s possible to style the tinyMCE editor for specific posts or post templates. Folks, it&#8217;s WordPress&#8230; anything&#8217;s possible! With my mission at hand, I [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Browse through more posts I've written about WordPress" href="http://matty.co.za/category/wordpress/"><img class="alignright size-full wp-image-1013" title="WordPress logo in blue" src="http://matty.co.za/wp-content/uploads/2010/04/blue-m.png" alt="Blue WordPress logo, courtesy http://wordpress.org/about/logos/" width="100" height="100" /></a>A few weeks ago, I blogged about <a title="Styling the tinyMCE editor in WordPress" href="http://matty.co.za/2010/05/editor-style-in-wordpress/">styling the tinyMCE editor in WordPress</a> to resemble your WordPress theme&#8217;s content area. On this post, I received a comment from LA, asking if it&#8217;s possible to style the tinyMCE editor for specific posts or post templates. Folks, it&#8217;s <a title="Browse more posts about WordPress" href="http://matty.co.za/category/wordpress/">WordPress</a>&#8230; anything&#8217;s possible!</p>
<p>With my mission at hand, I set to work. I&#8217;d been thinking about this for a while after writing the initial blog post and am please to say that I have found a solution. Please be sure you&#8217;ve read through the <a title="Styling the tinyMCE editor in WordPress" href="http://matty.co.za/2010/05/editor-style-in-wordpress/">initial blog post</a>, as the main points are covered over there.</p>
<p>There are a few steps we need to go through here. They&#8217;re pretty straight forward, so bear with me. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-1084"></span></p>
<p><img class="aligncenter size-full wp-image-1088" title="LA's question regarding styling the tinyMCE editor in WordPress" src="http://matty.co.za/wp-content/uploads/2010/08/la_question.png" alt="LA's question regarding styling the tinyMCE editor in WordPress" width="620" height="150" /></p>
<h3>Reference the global $post object</h3>
<p>First things first. How do we know what page, post or custom post type entry we&#8217;re working with? We need to get this information from WordPress. Luckily for us, WordPress also needs to know which entry we&#8217;re editing. We get this information by adding the following to the beginning of our function:</p>
<pre>global $post;</pre>
<p>This lets us work with the variable $post, which was previously created outside of our function. This variable is an object that holds information about the entry we are currently editing (ID, title, content, template, etc). We will be using this information at a later stage to insert our custom CSS file(s).</p>
<p>Due to this being a custom solution specific to a particular page, post or custom post type entry, this solution will only truly take effect on the &#8220;Edit&#8221; screens when targeting a specific entry or an entry with a particular custom template applied.</p>
<h3>Check if the file we&#8217;re looking for exists</h3>
<p>We wouldn&#8217;t want to call a file that we know doesn&#8217;t exist. Therefore, we will use a conditional (in this case, an IF statement) to determine whether or not to look for our custom CSS file, based on whether or not it exists.</p>
<h3>If the CSS file exists, add it to the list of CSS files to include</h3>
<p>After the line where we include our main editor-style.css file, add the following code:</p>
<pre><code>if ( file_exists( trailingslashit( get_stylesheet_directory() ) . 'assets/css/editor-style-' . $post-&gt;post_type . '.css' ) ) {

	if ( !empty($url) )
 	$url .= ',';

	// Change the path here if using sub-directory
 	$url .= trailingslashit( get_stylesheet_directory_uri() ) . 'assets/css/editor-style-' . $post-&gt;post_type . '.css';

} // End IF Statement
</code></pre>
<p>The above code checks if our custom CSS file (in this case, for a post type-specific CSS file) exists and, if it does, adds it to the list of CSS files to include in the tinyMCE editor. We include it after checking for our main editor-style.css file so that any of our custom CSS declarations override the defaults we have in the main editor-style.css file.</p>
<h3>Extending this functionality</h3>
<p>In the above example, I am including a custom CSS file based on the post type of the entry being edited. Altering this is relatively straight forward and can allow for custom CSS files depending on date published, post publish status, custom template being used and virtually any condition imaginable.</p>
<p>As an example of extending this functionality, we will include a file based on post ID. To do this, simply paste the above code into the function again and replace all instances of `post_type` with `ID` (such that $post-&gt;post_type becomes $post-&gt;ID). Thus, if a post has an ID of 7 (for example), the system will look for a file called editor-style-7.css and, if it exists, include it in the tinyMCE editor.</p>
<p>Please note that using post IDs can result in a large quantity of custom CSS files and is not recommended. The above is simply an example for extending the functionality we just created.</p>
<p>Folks, there you have it. Not too difficult, I hope. This allows for further customisation of the WordPress tinyMCE editor, creating a richer user experience for the bloggers using your theme, as well as creating a more accurate representation of what the post will look like on the front end of their WordPress website.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2010/08/more-wordpress-custom-editor-styles/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Styling the tinyMCE editor in WordPress</title>
		<link>http://matty.co.za/2010/05/editor-style-in-wordpress/</link>
		<comments>http://matty.co.za/2010/05/editor-style-in-wordpress/#comments</comments>
		<pubDate>Sun, 09 May 2010 11:54:18 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Support]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1048</guid>
		<description><![CDATA[With WordPress&#8217; easy to use nature and user interface, content management of websites is accessible to a vast range of users, from the Bill Gates&#8217; of the world right through to users who discovered this &#8220;internet thing&#8221; just yesterday. Once the concepts of &#8220;what is a content management system?&#8221; and &#8220;Okay, so this is the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1051" title="WordPress logo in Grey" src="http://matty.co.za/wp-content/uploads/2010/05/grey-m.png" alt="WordPress logo" width="100" height="100" />With WordPress&#8217; easy to use nature and user interface, content management of websites is accessible to a vast range of users, from the Bill Gates&#8217; of the world right through to users who discovered this &#8220;internet thing&#8221; just yesterday. Once the concepts of &#8220;what is a content management system?&#8221; and &#8220;Okay, so this is the &#8216;backend&#8217; and the website is the &#8216;frontend&#8217;&#8221; have been grasped, the usual question arises: &#8220;So, why does the backend content look different to the frontend content?&#8221;. To this question, we are about to say one thing: &#8220;Question&#8230; be gone!&#8221;<span id="more-1048"></span></p>
<h3>What are we going to achieve today?</h3>
<p>Today, we&#8217;re going to style the editor in the WordPress backend to resemble the content as it is in the theme that is being used on the frontend. Simple objective, so lets get started.</p>
<h3>What do we need?</h3>
<p>We&#8217;ll need three things to get this done: an editor-specific CSS stylesheet (I usually call this editor-style.css), a PHP function to do the work and a WordPress filter to piece things all together.</p>
<h3>Creating the editor-specific CSS stylesheet</h3>
<p>To do this, we need to keep in mind one thing: we&#8217;re cloning the styling of our theme&#8217;s content area into a new stylesheet. Simply loading the existing stylesheet in place of this file will not work out properly. One other thing to note is, the content area styles are now to be placed within the .mceContentBody{} CSS style. In addition to copying and pasting the content styling from my theme  (and changing all instances of #content to read .mceContentBody), I have also imported the CSS reset script I use via an @import call. This is to ensure added consistency within the editor styling. If your theme uses a CSS reset file, I would recommend importing it as well.</p>
<p>A snippet from my editor-style.css file looks like this:</p>
<pre><code>.mceContentBody { color: #666666; font-family: Arial, Helvetica, sans-serif !important; font-size: 12px; line-height: 18px; width: 640px; }
		.mceContentBody a, .mceContentBody a:visited { background: none; color: rgb(60, 130, 170); text-decoration: underline; }
		.mceContentBody a:hover { background: none; color: rgb(60, 140, 180); text-decoration: underline; }</code></pre>
<h3>Writing the PHP function to do the work</h3>
<p>Right, folks. This is where we do the main work involved with this. We&#8217;ll be writing a function to add our new editor-style.css file into the mix with the existing tinyMCE stylesheet in the backend. The function looks like this:</p>
<pre class="code"><code>
/**
 * matty_editor_style()
 */

function matty_editor_style( $url ) {

  if ( !empty($url) )
    $url .= ',';

  // Change the path here if using sub-directory
  $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'assets/css/editor-style.css';

  return $url;

} // End matty_editor_style()
</code></pre>
<p>And in English, this function reads like this:</p>
<p>The function accepts $url as a parameter. This is the existing tinyMCE stylesheet, passed through the WordPress filter. More on that in a bit. If the URL is provided (and not empty), add a comma (,) at the end of it. After that, create the URL to our editor-style.css file, as it sits in our theme folder, and add it to the end of $url. Return out the newly filtered $url back to the system.</p>
<h3>The WordPress filter that makes it all happen</h3>
<p>The last line. Nice and simple.</p>
<pre><code>add_filter( 'mce_css', 'matty_editor_style' );</code></pre>
<p>This is using the native WordPress function, add_filter(), to take in the &#8216;mce_css&#8217; stylesheet (the apply_filters() function is applied to the main tinyMCE CSS stylesheet before it is loaded into the system) and add the editor-style.css file into the mix with the existing file. No mess, no fuss.</p>
<p>Place the above PHP function and filter in your theme&#8217;s functions.php file, and you&#8217;re set.</p>
<p>And there we have it, folks. The editor in the WordPress backend no resembles the frontend of our WordPress theme. I hope this tutorial helps you in creating beautiful and easy to use content managed websites with WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2010/05/editor-style-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Enhancing the comments list in WordPress</title>
		<link>http://matty.co.za/2010/05/enhancing-wordpress-comments/</link>
		<comments>http://matty.co.za/2010/05/enhancing-wordpress-comments/#comments</comments>
		<pubDate>Sun, 02 May 2010 08:21:06 +0000</pubDate>
		<dc:creator>Matty</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Support]]></category>
		<category><![CDATA[WordPress Themes]]></category>

		<guid isPermaLink="false">http://matty.co.za/?p=1024</guid>
		<description><![CDATA[With the introduction of the wp_list_comments() function, WordPress enabled users to easily list comments on the websites without having to manually run a series of loops and queries to get the comments into neat XHTML. This function outputs default code with a selection of options for how this code is structured. Today we&#8217;ll be customising [...]]]></description>
			<content:encoded><![CDATA[<p>With the introduction of the wp_list_comments() function, WordPress enabled users to easily list comments on the websites without having to manually run a series of loops and queries to get the comments into neat XHTML. This function outputs default code with a selection of options for how this code is structured. Today we&#8217;ll be customising how comments are displayed in our WordPress theme, and adding a few extra enhancements to our comments while we&#8217;re at it (one of them being the Twitter username we added before). Lets start with the callback, shall we?<span id="more-1024"></span></p>
<h3>&#8220;Callback&#8221;, you say? Erm&#8230; what&#8217;s that?</h3>
<p>&#8220;callback&#8221; is one of the arguments we can pass to the wp_list_comments() function. The &#8220;callback&#8221; argument expects a string which, in this case, is the name of our callback function. Essentially, by using the &#8220;callback&#8221; argument, we&#8217;re saying to WordPress; &#8220;okay, that layout looks cool, but use this awesome layout instead&#8221;.</p>
<h3>So&#8230; this function&#8230;</h3>
<p>Right. The meat of this method is the callback function itself. This is the code that will be used to display each comment in the list. No need to create the list itself, just the items (as is most likely done in your comments.php theme file at this time). The callback function we&#8217;ll be creating looks something like this:</p>
<pre>
<div id="_mcePaste">&lt;?php</div>
<div id="_mcePaste">/**</div>
<div id="_mcePaste">* matty_comment_layout()</div>
<div id="_mcePaste">* A callback function to be used with the wp_list_comments() function.</div>
<div id="_mcePaste">*/</div>
<div id="_mcePaste">function matty_comment_layout ( $comment, $args, $depth ) {</div>
<div id="_mcePaste">$GLOBALS['comment'] = $comment;</div>
<div id="_mcePaste">$path_to_default_gravatar = get_bloginfo('stylesheet_directory') . '/assets/images/gravatar.png';</div>
<div id="_mcePaste">$twitter = '';</div>
<div id="_mcePaste">$twitter = get_comment_meta( get_comment_ID(), 'twitter', true );</div>
<div id="_mcePaste">if ( $twitter != '' ) {</div>
<div id="_mcePaste">$twitter = strtolower($twitter);</div>
<div id="_mcePaste">$twitter = str_replace(' ', '', $twitter);</div>
<div id="_mcePaste">$twitter = str_replace('.', '', $twitter);</div>
<div id="_mcePaste">$twitter = ' &lt;span&gt;(&lt;a href="http://twitter.com/' . $twitter . '" rel="nofollow"&gt;' . $twitter . '&lt;/a&gt;)&lt;/span&gt;';</div>
<div id="_mcePaste">} // End IF Statement</div>
<div id="_mcePaste">// Sanitise gravatar and make sure the image has an ALT attribute that isn't empty.</div>
<div id="_mcePaste">$gravatar = get_avatar($comment,$size='48',$default=$path_to_default_gravatar );</div>
<div id="_mcePaste">$gravatar = str_replace ("alt=''", 'alt="' . $comment-&gt;comment_author . '\'s Gravatar"', $gravatar);</div>
<div id="_mcePaste">?&gt;</div>
<div id="_mcePaste">&lt;li &lt;?php comment_class(); ?&gt; id="comment-&lt;?php echo $comment-&gt;comment_ID; ?&gt;"&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php echo $gravatar; ?&gt;&lt;?php printf( __('&lt;cite&gt;%s&lt;/cite&gt;'), get_comment_author_link(), $twitter ); ?&gt;&lt;/div&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php printf(__('Posted %1$s at %2$s (%3$s ago)', 'matty'),</div>
<div id="_mcePaste">get_comment_date(),</div>
<div id="_mcePaste">get_comment_time(),</div>
<div id="_mcePaste">human_time_diff(get_comment_date('U'), current_time('timestamp')) ); ?&gt;&lt;/div&gt;</div>
<div id="_mcePaste">&lt;?php if ($comment-&gt;comment_approved == '0') _e("\t\t\t\t\t&lt;span class='unapproved'&gt;Your comment is awaiting moderation.&lt;/span&gt;\n", 'matty') ?&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php comment_text(); ?&gt;&lt;/div&gt;&lt;!--/.comment-content--&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php printf(__('&lt;a href="%1$s" rel="bookmark" title="Permalink to ' . $comment-&gt;comment_author . '\'s comment"&gt;Permalink&lt;/a&gt;', 'matty'),</div>
<div id="_mcePaste">'#comment-' . $comment-&gt;comment_ID );</div>
<div id="_mcePaste">edit_comment_link(__('Edit', 'matty'), '&lt;span&gt;', '&lt;/span&gt;'); echo get_comment_reply_link(array_merge( $args, array('depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth']))) ?&gt;&lt;/div&gt;&lt;!--/.comment-links--&gt;</div>
<div id="_mcePaste">&lt;?php</div>
<div id="_mcePaste">} // End matty_comment_layout()</div>
<div id="_mcePaste">?&gt;</div>
</pre>
<p>Okay, that&#8217;s a long snippet. Lets go through it.</p>
<pre><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">function matty_comment_layout ( $comment, $args, $depth ) {</span></pre>
<p>This is our opening function tag. What&#8217;s important to note here is the passing of three arguments: the $comment we&#8217;ll be displaying, the $args that go along with that comment and the $depth of the comment in the structure.</p>
<pre>$GLOBALS['comment'] = $comment;
$path_to_default_gravatar = get_bloginfo('stylesheet_directory') . '/assets/images/gravatar.png';
$twitter = '';
$twitter = get_comment_meta( get_comment_ID(), 'twitter', true );

if ( $twitter != '' ) {

$twitter = strtolower($twitter);
$twitter = str_replace(' ', '', $twitter);
$twitter = str_replace('.', '', $twitter);
$twitter = ' &lt;span&gt;(&lt;a href="http://twitter.com/' . $twitter . '" rel="nofollow"&gt;' . $twitter . '&lt;/a&gt;)&lt;/span&gt;';

} // End IF Statement

// Sanitise gravatar and make sure the image has an ALT attribute that isn't empty.
$gravatar = get_avatar($comment,$size='48',$default=$path_to_default_gravatar );
$gravatar = str_replace ("alt=''", 'alt="' . $comment-&gt;comment_author . '\'s Gravatar"', $gravatar);</pre>
<p>I&#8217;ve bundled the above together as it&#8217;s all extra information that isn&#8217;t directly part of the comment itself.</p>
<p>The first line is to ensure we have the correct data for our comment. Below that, $path_to_default_gravatar is where we set the URL of a custom gravatar that we would like to use to replace the default gravatar used. This can be really useful when doing advanced premium WordPress themes. Now, onto the Twitter username.</p>
<p>We create a variable called $twitter, to which we will assign whatever is returned from the native WordPress function, get_comment_meta(). This function takes in the ID of the comment we&#8217;re currently processing, the field name (in this case &#8220;twitter&#8221;) and whether to expect a single value, instead of an array of values (in most cases, this should just be set to true, as we&#8217;re only expecting a single value here). If $twitter isn&#8217;t empty, we remove and spaces or full-stops from it and create an anchor XHTML tag pointing to the user&#8217;s Twitter profile page.</p>
<p>The last two lines get the user&#8217;s gravatar and make sure it has alternative text, to keep things neat and tidy. We&#8217;ve also told the get_avatar() function that, should it not find a gravatar for the user, it must use $path_to_default_gravatar as the default gravatar to display.</p>
<p>The rest of the comment function looks like this:</p>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">
<div id="_mcePaste">&lt;li &lt;?php comment_class(); ?&gt; id="comment-&lt;?php echo $comment-&gt;comment_ID; ?&gt;"&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php echo $gravatar; ?&gt;&lt;?php printf( __('&lt;cite&gt;%s&lt;/cite&gt;'), get_comment_author_link(), $twitter ); ?&gt;&lt;/div&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php printf(__('Posted %1$s at %2$s (%3$s ago)', 'matty'),</div>
<div id="_mcePaste">get_comment_date(),</div>
<div id="_mcePaste">get_comment_time(),</div>
<div id="_mcePaste">human_time_diff(get_comment_date('U'), current_time('timestamp')) ); ?&gt;&lt;/div&gt;</div>
<div id="_mcePaste">&lt;?php if ($comment-&gt;comment_approved == '0') _e("\t\t\t\t\t&lt;span class='unapproved'&gt;Your comment is awaiting moderation.&lt;/span&gt;\n", 'matty') ?&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php comment_text(); ?&gt;&lt;/div&gt;&lt;!--/.comment-content--&gt;</div>
<div id="_mcePaste">&lt;div&gt;&lt;?php printf(__('&lt;a href="%1$s" rel="bookmark" title="Permalink to ' . $comment-&gt;comment_author . '\'s comment"&gt;Permalink&lt;/a&gt;', 'matty'),</div>
<div id="_mcePaste">'#comment-' . $comment-&gt;comment_ID );</div>
<div id="_mcePaste">edit_comment_link(__('Edit', 'matty'), '&lt;span&gt;', '&lt;/span&gt;'); echo get_comment_reply_link(array_merge( $args, array('depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth']))) ?&gt;&lt;/div&gt;&lt;!--/.comment-links--&gt;</div>
</pre>
<p>The one very important thing to note here is the lack of a closing &lt;/li&gt; tag. WordPress inserts this automatically for us. While this still puzzles me, I&#8217;m sure there&#8217;s a decently good reason for it.</p>
<p>This code looks a bit random, doesn&#8217;t it? Well, it&#8217;s not really all that bad. Lets take a look.</p>
<p>We open the &lt;li&gt; tag and call the comment_class() WordPress function. This adds necessary microformats and comment-specific classes to the &lt;li&gt; for this comment. We also give it a unique ID.</p>
<p>Next up, we create a containing &lt;div&gt; tag and echo out our $gravatar image, as well as a prepared statement containing the comment author&#8217;s name and a link to their website (via the get_comment_author_link() function) and our $twitter URL, created in the snippet above.</p>
<p>Below the comment author information, we echo out a prepared statement with three values: the comment date, comment time and a human-readable version of how long ago the comment was posted (for example, 3 days ago).<br />
If the comment has not yet been approved, we let the user know this with <code>&lt;?php if ($comment-&gt;comment_approved == '0') _e("\t\t\t\t\t&lt;span class='unapproved'&gt;Your comment is awaiting moderation.&lt;/span&gt;\n", 'matty') ?&gt;</code>.</p>
<p>Now for the main event. The comment itself. A simple function called <code>comment_text()</code> gets this part of the show done.</p>
<p>Next up we create links that apply to this comment. In the above snippet, we create a permalink to the comment, an edit link for users who are logged in and have access to edit comments and a reply link (if we&#8217;re not too deep into the comments thread) that users can use to reply to the comment.</p>
<h3>That&#8217;s all, folks!</h3>
<p>Yep, that&#8217;s it. In the above snippet (which is almost a store-and-use-without-thinking snippet, in my opinion), we&#8217;ve created a customised layout for the way each comment is displayed, integrated a custom default gravatar, displayed a human-readable version of how long ago the comment was posted and integrated a Twitter username, submitted by the user when the comment was first made.</p>
<p>I&#8217;d really appreciate your thoughts on and ideas for this in the comments below.</p>
<p>Pretty cool, hey? <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://matty.co.za/2010/05/enhancing-wordpress-comments/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 657/713 objects using disk: basic

Served from: matty.co.za @ 2012-05-10 23:21:54 -->
