<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Digging into WordPress</title>
	
	<link>http://digwp.com</link>
	<description>Learn how to take your WordPress skills to the next level.</description>
	<lastBuildDate>Thu, 18 Mar 2010 12:24:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DiggingIntoWordpress" /><feedburner:info uri="diggingintowordpress" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>DiggingIntoWordpress</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Declare Multiple Widgetized Areas</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/LRdjYk-dUqE/</link>
		<comments>http://digwp.com/2010/03/declare-multiple-widgetized-areas/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:24:26 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1686</guid>
		<description><![CDATA[Have a bunch of different areas you wish to declare as a widgetized area? Save repetative code by creating a quick array of their names, then loop through that array calling the register_sidebar() function on each one. Elementary PHP stuff here, but hey, it just saved me quite a few lines of code in a [...]]]></description>
			<content:encoded><![CDATA[<p>Have a bunch of different areas you wish to declare as a widgetized area? Save repetative code by creating a quick array of their names, then loop through that array calling the register_sidebar() function on each one. Elementary PHP stuff here, but hey, it just saved me quite a few lines of code in a widget-heavy theme I am working on.</p>
<pre><code>if ( function_exists('register_sidebar') ) {

    $allWidgetizedAreas = array("Homepage Left", "Homepage Right", "Sidebar One", "Movies", "Admin");
    
    foreach ($allWidgetizedAreas as $WidgetAreaName) {
    
        register_sidebar(array(
           'name'=&gt; $WidgetAreaName,
           'before_widget' =&gt; '&lt;div id="%1$s" class="widget %2$s left half"&gt;',
           'after_widget' =&gt; '&lt;/div&gt;',
           'before_title' =&gt; '&lt;h3 class="widgettitle"&gt;',
           'after_title' =&gt; '&lt;/h3&gt;',
        ));
    
    }

}</code></pre>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/declare-multiple-widgetized-areas/">Permalink</a> | <a href="http://digwp.com/2010/03/declare-multiple-widgetized-areas/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/declare-multiple-widgetized-areas/&title=Declare Multiple Widgetized&nbsp;Areas">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/php/" title="View all posts in PHP" rel="category tag">PHP</a> | Tagged: <a href="http://digwp.com/tag/functions/" rel="tag">functions</a>, <a href="http://digwp.com/tag/php/" rel="tag">PHP</a>, <a href="http://digwp.com/tag/widgets/" rel="tag">widgets</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/LRdjYk-dUqE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/declare-multiple-widgetized-areas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/03/declare-multiple-widgetized-areas/</feedburner:origLink></item>
		<item>
		<title>WordPress Admin Bookmarklet</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/sWoYyrMaFjg/</link>
		<comments>http://digwp.com/2010/03/wordpress-admin-bookmarklet/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:15:15 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1678</guid>
		<description><![CDATA[Drag to your bookmarks bar, click, get a bunch of buttons for easy access to specific areas of your WordPress admin. No security concerns, other than taking people to your log in page, so assuming you have a good strong password you are fine. Also I suppose this assumes you have WP installed at the [...]]]></description>
			<content:encoded><![CDATA[<p>Drag to your bookmarks bar, click, get a bunch of buttons for easy access to specific areas of your WordPress admin. No security concerns, other than taking people to your log in page, so assuming you have a good strong password you are fine. Also I suppose this assumes you have WP installed at the root&#8230;</p>
<p><small><a href="http://iamnotagoodartist.com/other/wordpress-admin-toolbar-bookmarklet/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/03/wordpress-admin-bookmarklet/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/wordpress-admin-bookmarklet/">Permalink</a> | <a href="http://digwp.com/2010/03/wordpress-admin-bookmarklet/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/wordpress-admin-bookmarklet/&title=WordPress Admin&nbsp;Bookmarklet">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/sWoYyrMaFjg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/wordpress-admin-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://iamnotagoodartist.com/other/wordpress-admin-toolbar-bookmarklet/</feedburner:origLink></item>
		<item>
		<title>5 tips for using AJAX in WordPress</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/yssRJhwperk/</link>
		<comments>http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:12:18 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1688</guid>
		<description><![CDATA[WordPress has a bunch of AJAX abilities built in that you can access, without having to use any outside resources. Gary Cao shows how, pointing out good and bad practices.
Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book!

© 2010 Digging into WordPress &#124; Permalink &#124; Comments &#124; Add to
Delicious
Categorized: Links &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress has a bunch of AJAX abilities built in that you can access, without having to use any outside resources. Gary Cao shows how, pointing out good and bad practices.</p>
<p><small><a href="http://www.wphardcore.com/2010/5-tips-for-using-ajax-in-wordpress/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/">Permalink</a> | <a href="http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/&title=5 tips for using AJAX in&nbsp;WordPress">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/yssRJhwperk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/5-tips-for-using-ajax-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wphardcore.com/2010/5-tips-for-using-ajax-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>6 Ways to Display WordPress Post Content in Multiple Columns</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/yH6Pb0unq_c/</link>
		<comments>http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 08:25:45 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[posts]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1647</guid>
		<description><![CDATA[Most blogs display their content in single columns, but it&#8217;s also possible to display content in multiple columns. Multiple-column layouts are perfect for newspaper and magazine-style themes. Here are six ways of getting the job done.

Using CSS3 and progressive enhancement
Multiple columns by filtering the_content
More flexible multiple columns
Multiple loops displayed in multiple columns
Display your posts in [...]]]></description>
			<content:encoded><![CDATA[<p>Most blogs display their content in single columns, but it&rsquo;s also possible to display content in <strong>multiple columns</strong>. Multiple-column layouts are perfect for newspaper and magazine-style themes. Here are six ways of getting the job done.</p>
<ol id="post-menu">
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#css3">Using CSS3 and progressive enhancement</a></li>
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#filter">Multiple columns by filtering the_content</a></li>
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#flexible">More flexible multiple columns</a></li>
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#loops">Multiple loops displayed in multiple columns</a></li>
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#horizontal">Display your posts in horizontal display order with two columns</a></li>
<li><a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#bonus">Bonus: Display your category list in two columns</a></li>
</ol>
<h3 id="css3">1. Using CSS3 and progressive enhancement</h3>
<p>I think the easiest way to display your content in multiple columns is to apply a little <acronym title="Cascading Style Sheets">CSS</acronym>3 in progressively enhancing fashion. Let&rsquo;s say you have the following markup:</p>
<pre><code>&lt;div class="content"&gt;
	&lt;p&gt;Lorem ipsum..&lt;/p&gt;
	&lt;p&gt;Lorem ipsum..&lt;/p&gt;
	&lt;p&gt;Lorem ipsum..&lt;/p&gt;
&lt;/div&gt;</code></pre>
<p><span id="more-1647"></span></p>
<p>We can add the following <acronym title="Cascading Style Sheets">CSS</acronym> to display the content in multiple columns:</p>
<pre><code>.content {
	  -moz-column-count: 3;
	  -moz-column-gap: 10px;
	  -moz-column-rule: none;
	  -webkit-column-count: 3;
	  -webkit-column-gap: 10px;
	  -webkit-column-rule: none;
	column-count: 3;
	column-gap: 10px;
	column-rule: none;
	}</code></pre>
<p>This will display your content in three columns with a <code>10px</code> gap between each. This technique is a great way to enhance the display of your content for people running cool modern browsers like Safari and Firefox. What about folks visiting with Internet Exploder or older browsers? They will see your content displayed in a single column, just like they would have before you applied the multiple columns. <strong>Note</strong> that you can specify any number of coulmns and any width for the gap.</p>
<h3 id="filter">2. Multiple columns by filtering the_content</h3>
<p>If you need something a little more &ldquo;universal&rdquo; than what is currently available with <acronym title="Cascading Style Sheets">CSS</acronym>3, we can always dig into our template files, modify things at the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>/<acronym title="(eXtensible) Hypertext Markup Language">(X)HTML</acronym> level, and then style accordingly. Here is the technique provided by <a href="http://www.kriesi.at/archives/wordpress-display-content-in-multiple-columns" title="Wordpress: Display Content in multiple Columns">Kriesi.at</a>:</p>
<pre><code>function my_multi_col($content) {

	$columns = explode('&lt;h2&gt;', $content);
	$i = 0;

	foreach ($columns as $column) {
		if (($i % 2) == 0) {
			$return .= '&lt;div class="content_left"&gt;'."\n";
			if ($i &gt; 1) {
				$return .= "&lt;h2&gt;";
			} else {
				$return .= '&lt;div class="content_right"&gt;'."\n &lt;h2&gt;";
			}
			$return .= $column;
			$return .= '&lt;/p&gt;&lt;/div&gt;';
			$i++;
		}
		if(isset($columns[1])) {
	    		$content = wpautop($return);
		} else {
	    		$content = wpautop($content);
		}
		echo $content;
	}
}
add_filter('the_content', 'my_multi_col');</code></pre>
<p>Just place that into your active theme&rsquo;s <code>functions.php</code> file and then apply the following <acronym title="Cascading Style Sheets">CSS</acronym>:</p>
<pre><code>.content_right, .content_left{
	float: left;
	width: 45%;
	}
.content_left{
	padding-right: 5%;
	}</code></pre>
<p>Once implemented, this multi-column technique creates a a column for each instance of <code>&lt;h2&gt;</code> found within the post content. Thus, be sure to limit the number of <code>&lt;h2&gt;</code> elements to two in order to avoid layout breakage. <strong>Note</strong> that you could also modify the code to use a different element if the <code>&lt;h2&gt;</code> tag isn&rsquo;t good for you. Multiple columns doesn&rsquo;t get much easier, but just in case you need an alternate method for whatever reason, read on for some more great techniques.</p>
<h3 id="flexible">3. More flexible multiple columns</h3>
<p>The previous method works nice for two columns and no fuss, but for three or more columns we&rsquo;re going to need something a little more robust. fortunately, <a href="http://www.robsearles.com/2009/07/05/wordpress-multiple-content-columns/" title="Wordpress: Multiple Content Columns">Rob Searles</a> shares a technique that allows any number of columns with completely different content in each. This technique creates columns based on multiple instances of the <code>&lt;!--</code><code>more--&gt;</code> tag. There are several caveats, so check the orginal article for all the details.</p>
<p>Here are the steps involved in implementing this technique:</p>
<ol>
<li>Add the <code>my_multi_col_v2</code> function to your <code>functions.php</code> file</li>
<li>Add another snippet to your theme template file, for example <code>page.php</code></li>
<li>Add some <acronym title="Cascading Style Sheets">CSS</acronym> to format the markup into columns</li>
<li>Add a couple of <code>&lt;!--</code><code>more--&gt;</code> tags in your post or page to create the three columns</li>
</ol>
<p><strong>1.</strong> Let&rsquo;s go through these steps, beginning with the main function that you should place into your theme&rsquo;s <code>functions.php</code> file:</p>
<pre><code>function my_multi_col_v2($content){
	// run through a couple of essential tasks to prepare the content
	$content = apply_filters('the_content', $content);
	$content = str_replace(']]&gt;', ']]&amp;gt;', $content);
 
	// the first "more" is converted to a span with ID
	$columns = preg_split('/(&lt;span id="more-\d+"&gt;&lt;\/span&gt;)|(&lt;!--more--&gt;)&lt;\/p&gt;/', $content);
	$col_count = count($columns);
 
	if($col_count &gt; 1) {
		for($i=0; $i&lt;$col_count; $i++) {
			// check to see if there is a final &lt;/p&gt;, if not add it
			if(!preg_match('/&lt;\/p&gt;\s?$/', $columns[$i]) )  {
				$columns[$i] .= '&lt;/p&gt;';
			}
			// check to see if there is an appending &lt;/p&gt;, if there is, remove
			$columns[$i] = preg_replace('/^\s?&lt;\/p&gt;/', '', $columns[$i]);
			// now add the div wrapper
			$columns[$i] = '&lt;div class="dynamic-col-'.($i+1).'"&gt;'.$columns[$i].'&lt;/div&gt;';
		}
		$content = join($columns, "\n").'&lt;div class="clear"&gt;&lt;/div&gt;';
	}
	else {
		// this page does not have dynamic columns
		$content = wpautop($content);
	}
	// remove any left over empty &lt;p&gt; tags
	$content = str_replace('&lt;p&gt;&lt;/p&gt;', '', $content);
	return $content;
}</code></pre>
<p><strong>2.</strong> Once that&rsquo;s in place, replace your <code>the_content()</code> tag with the following code:</p>
<pre><code>$content = get_the_content('',FALSE,''); // arguments remove 'more' text
echo my_multi_col_v2($content);</code></pre>
<p><strong>3.</strong> The last bit of code that we need to setup is the <acronym title="Cascading Style Sheets">CSS</acronym> to make it all sweet:</p>
<pre><code>/* dynamic columns */
div.dynamic-col-1 { float: left; width: 38%; padding-right: 2%;}
div.dynamic-col-2 { float: left; width: 38%;padding-right: 2%;}
div.dynamic-col-3 { float: left; width: 20%;}
div.clear { clear: both; }</code></pre>
<p><strong>4.</strong> And last but not least, remember to add the two <code>&lt;!--</code><code>more--&gt;</code> tags in your post/page content to create the three columns.</p>
<p>That&rsquo;s all there is to it. Pretty good stuff, but even so, there are even more alternatives available. next we&rsquo;ll look at a technique for displaying multiple loops in multiple columns.</p>
<h3 id="loops">4. Multiple loops displayed in multiple columns</h3>
<p>Not too long ago, I wrote a post at Perishable Press explaining <a href="http://perishablepress.com/press/2008/09/01/multiple-loops-and-multiple-columns-with-wordpress/" title="Multiple Loops and Multiple Columns with WordPress, (X)HTML and CSS">how to display multiple loops with multiple columns</a>. The final product will look display something like this:</p>
<ul>
<li>First column, first loop: display posts #1-5</li>
<li>Second column, second loop: display posts #6-10</li>
<li>Third column, third loop: display posts #11-15</li>
</ul>
<p>Using WordPress and a little <acronym title="Cascading Style Sheets">CSS</acronym>, this configuration is relatively easy to accomplish. Let&rsquo;s cut right to the chase..</p>
<h4>Step 1: Setup the multiple loops</h4>
<p>The first thing we want to do is replace the standard WordPress loop with the following code:</p>
<pre><code>// FIRST LOOP: display posts 1 thru 5
&lt;?php query_posts('showposts=5'); ?&gt;
&lt;?php $posts = get_posts('numberposts=5&amp;offset=0'); foreach ($posts as $post) : start_wp(); ?&gt;
&lt;?php static $count1 = 0; if ($count1 == "5") { break; } else { ?&gt;

&lt;?php the_title(); ?&gt;
&lt;?php the_content(); ?&gt;

&lt;?php $count1++; } ?&gt;
&lt;?php endforeach; ?&gt;


// SECOND LOOP: display posts 6 thru 10
&lt;?php query_posts('showposts=5'); ?&gt;
&lt;?php $posts = get_posts('numberposts=5&amp;offset=5'); foreach ($posts as $post) : start_wp(); ?&gt;
&lt;?php static $count2 = 0; if ($count2 == "5") { break; } else { ?&gt;

&lt;?php the_title(); ?&gt;
&lt;?php the_content(); ?&gt;

&lt;?php $count2++; } ?&gt;
&lt;?php endforeach; ?&gt;


// THIRD LOOP: display posts 11 thru 15
&lt;?php query_posts('showposts=5'); ?&gt;
&lt;?php $posts = get_posts('numberposts=5&amp;offset=10'); foreach ($posts as $post) : start_wp(); ?&gt;
&lt;?php static $count3 = 0; if ($count3 == "5") { break; } else { ?&gt;

&lt;?php the_title(); ?&gt;
&lt;?php the_content(); ?&gt;

&lt;?php $count3++; } ?&gt;
&lt;?php endforeach; ?&gt;</code></pre>
<p>That&rsquo;s the juice right there. We have three loops, each displaying five posts. The first loop displays the first five posts, the second loop displays the next five posts, and the third loop displays the next five posts. Thus, this multiple-loop configuration displays the most recent 15 posts, each of which being unique. <a href="http://perishablepress.com/press/2008/09/01/multiple-loops-and-multiple-columns-with-wordpress/" title="Multiple Loops and Multiple Columns with WordPress, (X)HTML and CSS">See the original post</a> for more information, options and details.</p>
<h4>Step 2: Markup your theme template file(s)</h4>
<p>Now that we have the <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> in place, we are ready to add the <acronym title="(eXtensible) Hypertext Markup Language">(X)HTML</acronym> markup required for the final three-column configuration. There are many ways to accomplish this, this is merely one of them:</p>
<pre><code>&lt;div id="column_01"&gt;

	&lt;!-- FIRST LOOP --&gt;

&lt;/div&gt;

&lt;div id="column_wrap"&gt;

	&lt;div id="column_02"&gt;

		&lt;!-- SECOND LOOP --&gt;

	&lt;/div&gt;
	&lt;div id="column_03"&gt;

		&lt;!-- THIRD LOOP --&gt;
	
	&lt;/div&gt;

&lt;/div&gt;</code></pre>
<p>Here, each of the three loops will be placed into its own <code>div</code>, which then will be styled with a little <acronym title="Cascading Style Sheets">CSS</acronym> to transform it into one of the three columns. Note that you may want to change the <code>id</code> names of the divisions to better represent the particular semantics of your document. Now let&rsquo;s move on to the <acronym title="Cascading Style Sheets">CSS</acronym>..</p>
<h4>Step 3: Styling the columns with CSS</h4>
<p>The final step in the tutorial is to style the markup with <acronym title="Cascading Style Sheets">CSS</acronym>. Nothing too fancy, really. Creating the columns is merely a matter of floating the individual divs and applying a width to each of them:</p>
<pre><code>/* three column layout */
div#column_01 {
	float: left;
	clear: none;
	width: 30%;
	}
div#column_wrap {
	float: right;
	clear: none;
	width: 60%;
	}
	div#column_02 {
		float: left;
		clear: none;
		width: 45%;
		}
	div#column_03 {
		float: right;
		clear: none;
		width: 45%;
		}</code></pre>
<p>The trick here is to use <code>width</code> values that will create the correct column widths. The values used in the example produce three columns of <em>approximately</em> equal width. Again, for more information on the details of this technique, see the original post.</p>
<p>Once you get everything setup, your posts should display your multiple-loop content in multiple columns, with each column showing the contents of a different loop. This is a great way to customize your theme, making it possible to present lots of disparate information within an easy-to-understand layout. Even so, this technique may not do it for you either. If so, we&rsquo;ve got a couple more WordPress tricks up our sleeve!</p>
<h3 id="horizontal">5. Display your posts in horizontal display order with two columns</h3>
<p>That&rsquo;s a mouthful, isn&rsquo;t it? What we&rsquo;re doing in this section is changing the order in which your two-column posts appear on the page. Typically, your two-column layout displays posts like this:</p>
<pre><code>Post #1   |   Post #4
Post #2   |   Post #5
Post #3   |   Post #6
 .        |    .
 .        |    .
 .        |    .</code></pre>
<p>All of the multi-column methods we&rsquo;ve discussed so far result in this sort of post-display order. So now we want to change things up a bit and display our two-column posts in <em>horizontal</em> display order, like so:</p>
<pre><code>Post #1   |   Post #2
Post #3   |   Post #4
Post #5   |   Post #6
 .        |    .
 .        |    .
 .        |    .</code></pre>
<p>How is this accomplished? As explained in my <a href="http://perishablepress.com/press/2008/08/04/two-column-horizontal-sequence-wordpress-post-order/" title="Horizontally Sequenced Display Order for WordPress Posts in Two Columns">horizontal-display tutorial</a>, this is easily accomplished using two default loops and the <code>rewind_posts()</code> function. The first loop will display the posts in the first column, while the second loop will display the posts in the second column. To do this, we use <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>&rsquo;s <a  href="http://us.php.net/operators.arithmetic" title="PHP: Arithmetic Operators - Manual">modulus operator</a> to filter out every other post from the first loop, which will display posts in horizontal order.</p>
<p>To make this happen, first replace your default WordPress loop with the following code:</p>
<pre><code>&lt;?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query-&gt;next_post(); else : the_post(); ?&gt;

&lt;div id="left-column"&gt;
&lt;h1&gt;&lt;?php the_permalink(); ?&gt;&lt;/h1&gt;
&lt;?php the_content(); ?&gt;
&lt;/div&gt;

&lt;?php endif; endwhile; else: ?&gt;
&lt;div&gt;Alternate content&lt;/div&gt;
&lt;?php endif; ?&gt;

&lt;?php $i = 0; rewind_posts(); ?&gt;

&lt;?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query-&gt;next_post(); else : the_post(); ?&gt;

&lt;div id="right-column"&gt;
&lt;h1&gt;&lt;?php the_permalink(); ?&gt;&lt;/h1&gt;
&lt;?php the_content(); ?&gt;
&lt;/div&gt;

&lt;?php endif; endwhile; else: ?&gt;
&lt;div&gt;Alternate content&lt;/div&gt;
&lt;?php endif; ?&gt;</code></pre>
<p>With that code in place, oddly numbered posts will appear within a division identified with an attribute of <code>id="left-column"</code>. Likewise, even-numbered posts will appear within a division identified with an attribute of <code>id="right-column"</code>. Thus, we may apply the following <acronym title="Cascading Style Sheets">CSS</acronym> to position the divisions as two adjacent columns:</p>
<pre><code>div#left-column {
	width: 333px;
	float: left;
	clear: none;
	}
div#right-column {
	width: 333px;
	float: right;
	clear: none;
	}</code></pre>
<p>Of course, when it comes to configuring the WordPress loop and styling your page with <acronym title="Cascading Style Sheets">CSS</acronym>,<br />
anything is possible. Feel free to experiment and adapt this technique to suit your own diabolical purposes&nbsp;;) As with the other methods described in this <acronym title="Digging into WordPress">DiW</acronym> post, much more information is available for this technique at the <a href="http://perishablepress.com/press/2008/08/04/two-column-horizontal-sequence-wordpress-post-order/" title="Horizontally Sequenced Display Order for WordPress Posts in Two Columns">original article</a>, including a nice, <acronym title="Cascading Style Sheets">CSS</acronym>-only method that is sure to leave you breathless.</p>
<h3 id="bonus">6. Bonus: Display your category list in two columns</h3>
<p>Using a little <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> magic, we can get WordPress&rsquo; <code>wp_list_categories()</code> to display our <strong>categories in two columns</strong>. As <a href="http://www.blogohblog.com/10-wordpress-hacks-to-make-your-life-even-easier/" title="10 WordPress Hacks to Make Your Life Even Easier">Blog Oh Blog</a> explains, all you need is the following code placed in your theme file:</p>
<pre><code>&lt;?php // display categories in two columns
$cats = explode('&lt;br /&gt;', wp_list_categories('title_li=&amp;echo=0&amp;depth=1&amp;style=none'));
$cat_n = count($cats) - 1;
for ($i = 0; $i &lt; $cat_n; $i++):
	if ($i &lt; $cat_n/2):
		$cat_left = $cat_left.'&lt;li&gt;'.$cats[$i].'&lt;/li&gt;';
	elseif ($i &gt;= $cat_n/2):
		$cat_right = $cat_right.'&lt;li&gt;'.$cats[$i].'&lt;/li&gt;';
	endif;
endfor; ?&gt;

&lt;ul class="left"&gt;
	&lt;?php echo $cat_left; ?&gt;
&lt;/ul&gt;
&lt;ul class="right"&gt;
	&lt;?php echo $cat_right; ?&gt;
&lt;/ul&gt;</code></pre>
<p>Just use that code where you would like the categories to appear and enjoy the results.</p>
<h3>Wrapping it up</h3>
<p>Hopefully these techniques will inspire and enable you to break out of the &ldquo;single-column&rdquo; mindset and explore some multi-column possibilities. Using multiple columns for your content is a great way to enhance the visual appeal of your design and readability of your content.</p>
<p>There is SO much you can do with WordPress, <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>, <acronym title="(eXtensible) Hypertext Markup Language">(X)HTML</acronym>, and <acronym title="Cascading Style Sheets">CSS</acronym>. The possibilities are endless indeed. The multiple-column techniques presented in this article provide a great starting point for creating more elaborate and sophisticated page layouts. So experiment, have fun, and be safe!!</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/">Permalink</a> | <a href="http://digwp.com/2010/03/wordpress-post-content-multiple-columns/#comments">16 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/wordpress-post-content-multiple-columns/&title=6 Ways to Display WordPress Post Content in Multiple&nbsp;Columns">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/css/" title="View all posts in CSS" rel="category tag">CSS</a>,  <a href="http://digwp.com/category/design/" title="View all posts in Design" rel="category tag">Design</a> | Tagged: <a href="http://digwp.com/tag/css/" rel="tag">CSS</a>, <a href="http://digwp.com/tag/loop/" rel="tag">loop</a>, <a href="http://digwp.com/tag/php/" rel="tag">PHP</a>, <a href="http://digwp.com/tag/posts/" rel="tag">posts</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/yH6Pb0unq_c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/wordpress-post-content-multiple-columns/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/03/wordpress-post-content-multiple-columns/</feedburner:origLink></item>
		<item>
		<title>Add Classes to post_class</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/mQMGcPdTMK4/</link>
		<comments>http://digwp.com/2010/03/add-classes-to-post_class/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 21:04:45 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1567</guid>
		<description><![CDATA[The post_class() function in WordPress is pretty darn useful. It is used like this, in most templates, in a wrapping div of all the content you are outputting:
&#60;div &#60;?php post_class() ?&#62; id="post-&#60;?php the_ID(); ?&#62;"&#62;
   &#60;!-- Post stuff --&#62;
&#60;/div&#62;
I was in a circumstance where I wanted to add an additional class to what that [...]]]></description>
			<content:encoded><![CDATA[<p>The post_class() function in WordPress is pretty darn useful. It is used like this, in most templates, in a wrapping div of all the content you are outputting:</p>
<pre><code>&lt;div &lt;?php post_class() ?&gt; id="post-&lt;?php the_ID(); ?&gt;"&gt;
   &lt;!-- Post stuff --&gt;
&lt;/div&gt;</code></pre>
<p>I was in a circumstance where I wanted to add an additional class to what that was outputting. My thought process went like this:</p>
<ol>
<li>Arg. I guess I&#8217;m going to have to write a function to filter the output of that function. Let&#8217;s begin the research.</li>
<li>Wait. I bet that function has an alternate that returns a string rather than echos it. I&#8217;ll just use that, and echo it out along with my own custom class.</li>
<li>Double wait. I bet those smart WordPress folks have thought of this&#8230;</li>
</ol>
<p><span id="more-1567"></span></p>
<h3>1. Filtering</h3>
<p>This kind of thing is generally beyond my comfort zone, but you&#8217;d basically write your own little function which takes in what the output would have been, add you own stuff to it, then return the new value.</p>
<p>Then call the new function with a filter in your functions.php file:</p>
<pre><code>add_filter('post_class','add_my_stuff');</code></pre>
<h3>2. Output exiting classes, then add yours</h3>
<p>Like most functions that echo stuff, there is a version that doesn&#8217;t echo stuff, in which &#8220;get_&#8221; prefaces the function name. I didn&#8217;t even have to look it up I just knew there would be. Since it&#8217;s a list, this function returns an array, so to output them, you&#8217;ll need to loop through the array:</p>
<pre><code>&lt;div class="&lt;?php $allClasses = get_post_class(); foreach ($allClasses as $class) { echo $class . " "; } ?&gt; group" id="post-&lt;?php the_ID(); ?&gt;"&gt;</code></pre>
<p>The cool part here is that is doesn&#8217;t add &#8220;class=&#8221; in the output, you can do that yourself, meaning that I can add my own classes after the output is finished.</p>
<h3>3. Built in&#8230;</h3>
<p>Of course, as it turns out, this is far easier than #2 made it out to be. To add additional classes, just pass them as a parameter!</p>
<pre><code>&lt;?php post_class('special'); ?&gt;</code></pre>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/add-classes-to-post_class/">Permalink</a> | <a href="http://digwp.com/2010/03/add-classes-to-post_class/#comments">2 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/add-classes-to-post_class/&title=Add Classes to&nbsp;post_class">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/php/" title="View all posts in PHP" rel="category tag">PHP</a> | Tagged: <a href="http://digwp.com/tag/classes/" rel="tag">classes</a>, <a href="http://digwp.com/tag/functions/" rel="tag">functions</a>, <a href="http://digwp.com/tag/theme/" rel="tag">Theme</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/mQMGcPdTMK4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/add-classes-to-post_class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/03/add-classes-to-post_class/</feedburner:origLink></item>
		<item>
		<title>WordPress vs. ExpressionEngine: Apples and Oranges?</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/wdVvO30eo54/</link>
		<comments>http://digwp.com/2010/03/wordpress-vs-ee/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 20:38:21 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1633</guid>
		<description><![CDATA[Marcus Neto attempts to compares the two CMSs while explaining why he likes ExpressionEngine. Are they really apples or oranges? I suppose you could say that. Apples and oranges are both popular spherical fruit. They have more in common than theyhave different. Same with the two CMSs. 
While I&#8217;m 98% a WordPress guy, there are [...]]]></description>
			<content:encoded><![CDATA[<p>Marcus Neto attempts to compares the two CMSs while explaining why he likes ExpressionEngine. Are they really apples or oranges? I suppose you could say that. Apples and oranges are both popular spherical fruit. They have more in common than theyhave different. Same with the two CMSs. </p>
<p>While I&#8217;m 98% a WordPress guy, there are a few circumstances I might take the EE route, like when:</p>
<p>1) I knew I was going to need a whole bunch of different custom data types and groups and didn&#8217;t feel like dealing with the whole Pods or Flutter setup.</p>
<p>2) I also knew no newbie client was going to need to get in there.</p>
<p><small><a href="http://www.webdesignerdepot.com/2010/03/wordpress-vs-expressionengine-apples-and-oranges/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/03/wordpress-vs-ee/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/wordpress-vs-ee/">Permalink</a> | <a href="http://digwp.com/2010/03/wordpress-vs-ee/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/wordpress-vs-ee/&title=WordPress vs. ExpressionEngine: Apples and&nbsp;Oranges?">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/wdVvO30eo54" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/wordpress-vs-ee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.webdesignerdepot.com/2010/03/wordpress-vs-expressionengine-apples-and-oranges/</feedburner:origLink></item>
		<item>
		<title>Shortcodes in Widgets</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/QDKWdhrw1BQ/</link>
		<comments>http://digwp.com/2010/03/shortcodes-in-widgets/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:07:32 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1560</guid>
		<description><![CDATA[I had occasion the other day to run a shortcode inside of a text widget. You know shortcodes&#8230; we talk about them all the time. They are keywords in [square brackets] that do something special. Sometimes something really simple like returning a string (so you can have a global location to change that string) or [...]]]></description>
			<content:encoded><![CDATA[<p>I had occasion the other day to run a shortcode inside of a text widget. You know shortcodes&#8230; we talk about them <a href="http://digwp.com/tag/shortcode/">all the time</a>. They are keywords in [square brackets] that do something special. Sometimes something really simple like returning a string (so you can have a global location to change that string) or something complicated like call a plugin that does something fancy like build a photo gallery.</p>
<p>But alas&#8230;</p>
<div class="image-wrap">
<img src="http://digwp.com/wp-content/blog-images/shortcodeinwidget.png" width="371" height="222" alt="" title="" /><br />
This ain&#8217;t gonna work &#8220;out-of-the-box&#8221;
</div>
<p><span id="more-1560"></span></p>
<p>After tinkering with some far-too-complicated solutions, someone on Twitter helped me with a deliciously simple solution: Just add this to your functions.php file:</p>
<pre><code>add_filter('widget_text', 'do_shortcode');</code></pre>
<p>This will ensure that the text content of widgets is parsed for shortcodes and those shortcodes are ran. Awesome.</p>
<p>Stephanie Leary wrote a great article on <a href="http://sillybean.net/wordpress/content/using-shortcodes-everywhere/">Using Shortcodes Everywhere</a>, which covers this as well as using shortcodes in a bunch of other places: Comments, templates, excerpts, etc.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/shortcodes-in-widgets/">Permalink</a> | <a href="http://digwp.com/2010/03/shortcodes-in-widgets/#comments">4 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/shortcodes-in-widgets/&title=Shortcodes in&nbsp;Widgets">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/php/" title="View all posts in PHP" rel="category tag">PHP</a> | Tagged: <a href="http://digwp.com/tag/shortcode/" rel="tag">shortcode</a>, <a href="http://digwp.com/tag/widgets/" rel="tag">widgets</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/QDKWdhrw1BQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/shortcodes-in-widgets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/03/shortcodes-in-widgets/</feedburner:origLink></item>
		<item>
		<title>How to Add Your Plugin to the WordPress Plugin Directory</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/JUeszFJBXi8/</link>
		<comments>http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:49:12 +0000</pubDate>
		<dc:creator>Jeff Starr</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1548</guid>
		<description><![CDATA[Getting your plugins listed in the official WordPress Plugin Directory is considered a chore by many, but it&#8217;s nothing that should stop you from sharing your plugin with the community at large. Up until now, I haven&#8217;t really bothered with adding my plugin collection to the Directory, but after Herb Goodman helped to package my [...]]]></description>
			<content:encoded><![CDATA[<p>Getting your plugins listed in the official <a href="http://wordpress.org/extend/plugins/" title="Plugin Directory">WordPress Plugin Directory</a> is considered a chore by many, but it&rsquo;s nothing that should stop you from sharing your plugin with the community at large. Up until now, I haven&rsquo;t really bothered with adding <a href="http://perishablepress.com/press/2006/09/04/perishable-press-wordpress-plugins/" title="Perishable Press WordPress Plugins">my plugin collection</a> to the Directory, but after <a href="http://www.hsgoodman.org/" title="hsgoodman.org">Herb Goodman</a> helped to package my recent <a href="http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/" title="">Block Bad Queries plugin</a>, I figured now was a good time to dig in and learn the ropes. It turns out the process only took about an hour to complete, not including the waiting period for access to the Subversion Repository (which was about 18 hours). Definitely worth the potential exposure provided by having your plugin listed in the official directory.</p>
<blockquote><p>If you are a seasoned plugin developer, you already know how to hook it up at the WordPress Directory, but for those who don&rsquo;t, this <acronym title="Digging into WordPress">DiW</acronym> tutorial will show you everything you need to know.</p></blockquote>
<p><span id="more-1548"></span></p>
<h3>Why host your plugin at the WP Directory?</h3>
<p>Some of the benefits of hosting your plugin at the WordPress Plugin Directory:</p>
<ul>
<li>Track basic statistics regarding how many people are downloading and when</li>
<li>Provide a centralized location for users to leave comments and feedback</li>
<li>Get your plugin rated against the many other hosted WordPress plugins</li>
<li>And of course, give your plugin greater exposure to the WP community</li>
</ul>
<p>Further, it seems that plugins hosted at the official directory are perceived to be associated with a greater degree of &ldquo;trustworthiness.&rdquo; People <em>trust</em> WordPress, and they also trust the various resources (plugins, themes, etc.) made available to them through the <code>wordpress.org</code> website. Basically, if you&rsquo;re writing plugins for the WordPress community, you should be sharing them with as many people possible. The Plugin Directory does this exceedingly well.</p>
<p>&ldquo;Worth playing for?&rdquo; Let&rsquo;s look at a quick overview before digging into the specifics of getting your plugin added to the Directory..</p>
<h3>Overview</h3>
<p>To help get a sense of direction before getting started, consider this overview of events:</p>
<ul>
<li>Write and prepare your plugin</li>
<li>Prepare the readme.txt file</li>
<li>Sign up for access to the Subversion Repository</li>
<li>Wait for approval and <acronym title="Subversion (version control system)">SVN</acronym> access information</li>
<li>Use Subversion software to upload your plugin files</li>
<li>Wait a few minutes for the system to add your plugin to the Plugin Directory</li>
</ul>
<p>Of course, the big hurdle that many &ldquo;would-be&rdquo; contributors have is using the <acronym title="Subversion (version control system)">SVN</acronym>/Subversion system and software. To be honest, this was one of the reasons why I never bothered adding my other plugins, but now that I&rsquo;ve seen how easy it actually is (once you learn it), I will most likely add my other plugins as well (eventually).</p>
<h3>First steps</h3>
<p>First, get your plugin and files ready. You don&rsquo;t need to compress anything with <code>zip</code> or <code>tar</code> because the <acronym title="Subversion (version control system)">SVN</acronym> system will do that automatically for you based on the contents of your plugin. In my case, the plugin was Block Bad Queries, which contains the following two files:</p>
<ul>
<li><code>block-bad-queries.php</code></li>
<li><code>readme.txt</code></li>
</ul>
<p>The actual plugin file is the &ldquo;<code>block-bad-queries.php</code>&rdquo;. The &ldquo;<code>readme.txt</code> is the only other required file. If you have multiple plugin files, that&rsquo;s fine too, they will be uploaded and managed together during the subversion process.</p>
<p>For more information on getting things ready, check out <a href="http://codex.wordpress.org/Plugin_Submission_and_Promotion" title="Plugin Submission and Promotion">Plugin Submission and Promotion</a> at the Codex. A key factor in the process is a well-written <code>readme.txt</code> file, which we&rsquo;ll look at next..</p>
<h3>Pimp your readme.txt file</h3>
<p>I think having a well-prepared <code>readme.txt</code> file is one of the things that helped everything go smoothly for my first time out. Your plugin&rsquo;s <code>readme.txt</code> is used for the content of the various pages in a typical plugin listing:</p>
<ul>
<li>Plugin Name</li>
<li>Description</li>
<li>Installation</li>
<li>Faq</li>
<li>Screenshots</li>
<li>Other Notes</li>
<li>Changelog</li>
<li>Stats</li>
<li>Admin</li>
</ul>
<p>That&rsquo;s basically it. If your <code>readme.txt</code> contains each of these sections, you should be good to go. There are various details required for certain sections, such as the opening &ldquo;<code>Plugin</code>&nbsp;<code>Name</code>&rdquo; information, which requires the following specifics (using <acronym title="Block Bad Queries">BBQ</acronym> as an example):</p>
<pre><code>=== Plugin Name ===

Contributors: Jeff Starr
Plugin Name: Block Bad Queries
Plugin URI: http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/
Tags: wp, protect, php, eval, malicious, url
Author URI: http://perishablepress.com/
Author: Perishable Press
Requires at least: 2.3
Tested up to: 2.9
Stable tag: 1.0
Version: 1.0 </code></pre>
<p>I think we&rsquo;re all familiar with this type of information &ndash; something similar is included at the top of virtually every plugin (and theme) in existence. In any case, this is the first part of a proper <code>readme.txt</code> file, as seen in the <a href="http://wordpress.org/extend/plugins/about/readme.txt">WordPress/bbPress plugin readme file standard</a>, which also contains details and further information about the various requirements.</p>
<p>So, to put all of this together and create your own <code>readme.txt</code> file, just copy &amp; paste the following template into a blank <code>.txt</code> file and flesh it out with your own details:</p>
<pre><code>=== Plugin Name ===

Contributors:      (plugin contributors)
Plugin Name:       (name of your plugin)
Plugin URI:        (web page for plugin)
Tags:              (tags for the plugin)
Author URI:        (plugin authors site)
Author:            (the plugin's author)
Donate link:       (a link for donating)
Requires at least: (minimum required WP) 
Tested up to:      (tested WP up to ver)
Stable tag:        (plugin's stable ver)
Version:           (plugins current ver)

== Description ==

== Installation ==

== Upgrade Notice ==

== Screenshots ==

== Changelog ==

== Frequently Asked Questions ==

== Donations ==</code></pre>
<p>Aside from wanting to put the &ldquo;Plugin Name&rdquo; section at the top of the file, these different sections can be rearranged in any order, but they all need to be present in order to adhere to WordPress guidelines and pass the <a href="http://wordpress.org/extend/plugins/about/validator/" title="Readme Validator">readme validation</a>. For more information on fleshing out each of these different sections, check out the <a href="http://wordpress.org/extend/plugins/about/readme.txt">standard readme.txt example</a>. Once you get everything pimped and ready, the readme validator will display the good news:</p>
<blockquote><p>Your readme.txt rocks. Seriously. Flying colors.</p></blockquote>
<p>If you don&rsquo;t see this message, you&rsquo;ll get a list of things that need fixed in order to pass validation. The validator is a great tool that makes it easy to put together a proper <code>readme.txt</code> file.</p>
<h4>A few notes on the readme file</h4>
<p>Here are a few notes that I found helpful while creating the <code>readme.txt</code> file:</p>
<ul>
<li>The readme file uses <a href="http://daringfireball.net/projects/markdown/syntax" title="Markdown">markdown</a> for marking up your info with links, lists and so on.</li>
<li>You may use <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> in your readme content (escape with backticks: <code>`&lt;?php</code>&nbsp;<code>?&gt;`</code>)</li>
<li>Use asterisks for *emphasized text*</li>
<li>Use double asterisks for **strong text**</li>
</ul>
<p>As you can see, the <code>readme.txt</code> file is quite flexible, enabling you to customize your plugin&rsquo;s information as provided in the Plugin Repository.</p>
<h3>Prepare the plugin file</h3>
<p>After creating and testing your plugin, you need to give it a license. Here is what the WordPress Codex has to say about it:</p>
<ul>
<li>Your plugin must be <a href="http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses">GPLv2 Compatible</a>.</li>
<li>The plugin most not do anything illegal, or be morally offensive.</li>
<li>You have to actually use the <a href="http://subversion.tigris.org/">subversion</a> repository we give you in order for your plugin to show up on this site. The WordPress Plugins Directory is a hosting site, not a listing site.</li>
<li>The plugin must not embed external links on the public site (like a &ldquo;powered by&rdquo; link) without explicitly asking the user&rsquo;s permission.</li>
<li>If you don&rsquo;t specify a v2-compatible license, what you check in is explicitly GPLv2.</li>
</ul>
<p>Once you&rsquo;ve given your plugin the required license &#8212; either <strong>explicitly</strong> by <em>including</em> the license or <strong>implicitly</strong> by not including <em>any</em> license &#8212; you&rsquo;re ready to get hosted at the Repository. Take a few deep breaths and clear your mind..</p>
<h3>Sign up for access to the Plugin Repository</h3>
<p>Now with your plugin files ready to go, visit the <a href="http://wordpress.org/extend/plugins/add/">Sign-up page</a>, login to your account, and fill out the form with the following information:</p>
<ul>
<li>Plugin Name (required)</li>
<li>Plugin Description (required)</li>
<li>Plugin URL</li>
</ul>
<p>After submitting the form, be prepared to wait awhile to be approved access to the subversion repository. For my plugin, it took around 18 hours to receive a response. Just be patient, if everything looks good, someone will approve your request within a reasonably undefined amount of time. Eventually, you should receive an email with all the information you need to access the <a id="subversion" href="http://wordpress.org/extend/plugins/about/svn/">Subversion Repository</a>. This is where you will upload and store your plugin. The system will use the files and information included in the Subversion Repository to generate the actual web pages that appear in the <a href="http://wordpress.org/extend/plugins/" title="WordPress Plugin Directory">Plugin Directory</a> with all of the other plugins. It usually takes a few minutes for the system to create your plugin&rsquo;s entry, so be patient after uploading. Just as a general reference, I think I waited something like five or ten minutes before seeing my plugin listed in the Plugin Browser.</p>
<h3>Use Subversion software to upload your plugin files</h3>
<p>At this point, you&rsquo;ve been granted access to the <acronym title="Subversion (version control system)">SVN</acronym> repository and are ready to upload your files and call it done (until the next plugin update). To begin this task, familiarize yourself (if necessary) with the basics of <a href="http://ptahdunbar.com/how-to/subversion-demystified-using-wordpress/" title="Subversion Demystified using WordPress">using Subversion with WordPress</a>. </p>
<blockquote><p>There&rsquo;s a LOT to learn about Subversion, but don&rsquo;t let that stop you from making quick use of it to get the job done.</p></blockquote>
<h4>What is Subversion?</h4>
<p>Basically, Subversion is an open-source piece of software that people use to more easily manage files and directories as they change over time. The key thing about Subversion is that it enables you to restore previous versions of your data and understand how things have changed. This &ldquo;time-machine&rdquo; functionality is especially useful for managing things like continually changing source code, and makes managing thousands of plugins <em>much</em> easier.</p>
<h4>How do I use Subversion?</h4>
<p>To use Subversion, you&rsquo;ll need some software. Mac people get it pre-installed with Leopard, and Windows peeps can download the binary installer <a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91" title="Subversion Binary Downloads">here</a>. Keep in mind that, for either operating system, Subversion is something you run through either Terminal (Mac) or the Command Prompt (Win) as a series of commands. As you can imagine, there are a gazillion commands available, but we&rsquo;ll only be needing a select few for our purposes here.</p>
<h4>Please don&rsquo;t make me use the command line!</h4>
<p>If the thought of using the command line to run software makes your stomach turn, you can use Subversion through a graphical interface such as <a href="http://www.versionsapp.com/" title="Versions">Versions</a> for Mac, and/or<br />
<a href="http://tortoisesvn.tigris.org/" title="Tortoise">Tortoise</a> for Windows. I haven&rsquo;t used either of these apps, but they certainly <em>look</em> more inviting than the command prompt, which is what we&rsquo;re rolling with for this tutorial.</p>
<h4>How does it work?</h4>
<p>There are two sets of files we&rsquo;re working with: <strong>local files</strong> (on your computer) and <strong>remote files</strong> (on the server). For each set of files, we want the following directory structure (using my plugin as an example):</p>
<pre><code>root-folder/
	/trunk/
		block-bad-queries.php
		readme.txt
	/branches/
	/tags/</code></pre>
<p>To get started, we&rsquo;ll place our files into the <code>/trunk/</code> directory, and then in the future add new versions to either the <code>/branches/</code> directory (for <em>major</em> updates) or <code>/tags/</code> directory (for <em>minor</em> updates). </p>
<p>Once uploaded, your files are stored in the central plugin repository on WordPress servers. From the repository, anyone can <strong>check out</strong> a copy of your file(s), but <em>only you</em> (the plugin author) have the authority to <strong>check in</strong> new file(s). Using Subversion, any changes made to your local files are mirrored exactly on the server, and eventually reflected in your plugin pages in the WordPress.org plugin directory.</p>
<h4>Add your plugin to the Repository</h4>
<p>Now that we have our files ready and Terminal (or Command Prompt) open, let&rsquo;s wrap this up and upload our files to the Plugin Repository. Here&rsquo;s an overview of what we&rsquo;re going to do:</p>
<ol>
<li>Check out the blank repository (i.e., the empty directory structure)</li>
<li>Add your files to the local <code>/trunk/</code> directory on your computer</li>
<li>Update the repository with copies of your local files</li>
</ol>
<p>Here&rsquo;s how to do it with Mac Terminal, and it&rsquo;s very similar for Windows Command Prompt:</p>
<pre><code>$ mkdir my-local-dir
$ svn co http://svn.wp-plugins.org/your-plugin-name my-local-dir
$ cd my-local-dir/
my-local-dir/$ cp ~/my-plugin.php trunk/my-plugin.php
my-local-dir/$ cp ~/readme.txt trunk/readme.txt
my-local-dir/$ svn add trunk/*
my-local-dir/$ svn ci -m 'add some notes here'</code></pre>
<p>And here are the same commands with comments and returned messages:</p>
<pre><code># create a local folder for your copy of the repository

$ mkdir my-local-dir

# download the empty directory structure to your new folder

$ svn co http://svn.wp-plugins.org/your-plugin-name my-local-dir
&gt; A	my-local-dir/trunk
&gt; A	my-local-dir/branches
&gt; A	my-local-dir/tags
&gt; Checked out revision 11325.

# copy your plugin files to the local trunk directory

$ cd my-local-dir/
my-local-dir/$ cp ~/my-plugin.php trunk/my-plugin.php
my-local-dir/$ cp ~/readme.txt trunk/readme.txt

# register the new files with Subversion

my-local-dir/$ svn add trunk/*
&gt; A	trunk/my-plugin.php
&gt; A	trunk/readme.txt

# update the Repository with the new files

my-local-dir/$ svn ci -m 'add some notes here'
&gt; Adding	trunk/my-plugin.php
&gt; Adding	trunk/readme.txt
&gt; Transmitting file data ..
&gt; Committed revision 11326.

# All done!</code></pre>
<p>That may look like a mouthful, but it&rsquo;s actually only about seven commands, even fewer if you manually create the directory structure and add the local files yourself. You should also keep the following notes in mind if you are new to the whole &ldquo;command line&rdquo; thing:</p>
<ul>
<li>Any line prefixed with a pound sign <code>#</code> is a comment and should not be used as a command.</li>
<li>Lines beginning with a &rdquo;<code>&gt;</code>&rdquo; character indicate a response from the software and should not be used as a command.</li>
<li>All of the specific file and directory names need to be changed to match your own.</li>
<li>The &ldquo;<code>-m 'add some notes here'</code>&rdquo; in the last command is used to add notes for the event &#8212; they may be anything you wish (or none at all).</li>
<li>At the last step, you may be prompted for your username and password, which should be the same as used when logged into the WordPress.org site.</li>
</ul>
<p>After running those commands, your plugin will be in the Repository and ready for the system to automatically create your actual plugin pages as they will appear in the Plugin Directory. This usually takes some time, so grab a drink and kick back for around five to ten minutes. Eventually, you will see your plugin appear on the <a href="http://wordpress.org/extend/plugins/browse/new/" title="Newest WordPress Plugins">Newest Plugins</a> page, and then also at its dedicated page, which will be something like this:</p>
<p><code>http://wordpress.org/extend/plugins/your-new-plugin/</code></p>
<p>Once you get this far, you&rsquo;re golden. There are many other cool things you can do with Subversion to manage and update your plugin. To get started with updating and tagging, check out the <a href="http://wordpress.org/extend/plugins/about/svn/" title="How to Use Subversion">How to Use Subversion</a> in the Plugin Directory. And for even more information on the entire process of adding your plugins, check out the <a href="http://wordpress.org/extend/plugins/about/faq/" title="Developer FAQ">Plugin Developer FAQ</a>.</p>
<h3>Final thoughts..</h3>
<p>Overall, getting my first plugin hosted at the WordPress Plugin Directory was a great learning experience that will make it easy to add other plugins in the future. Hopefully the fruits of my labor will help you when adding your own plugins to the Directory. As always, feel free to chime in with suggestions, questions and concerns about any of the techniques described here. It would be great to hear more about using Subversion (tips, tricks, etc.).</p>
<p>Also, if you are interested, you can see the result of all this work by checking out the <a href="http://wordpress.org/extend/plugins/block-bad-queries/" title="WordPress Plugin: Block Bad Queries (BBQ)">Block Bad Queries (BBQ) Plugin at the Plugin Directory</a>. There&rsquo;s still a few details that need to be added/tweaked, but it&rsquo;s great just having it in there.</p>
<p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/">Permalink</a> | <a href="http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/#comments">7 comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/&title=How to Add Your Plugin to the WordPress Plugin&nbsp;Directory">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/plugins/" title="View all posts in Plugins" rel="category tag">Plugins</a> | Tagged: <a href="http://digwp.com/tag/plugin/" rel="tag">plugin</a>, <a href="http://digwp.com/tag/svn/" rel="tag">svn</a></small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/JUeszFJBXi8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/</feedburner:origLink></item>
		<item>
		<title>PubSubHubbub Now On All WordPress.com sites (+ plugin for self hosted sites)</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/-aQdqjPCW0E/</link>
		<comments>http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 17:54:45 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1546</guid>
		<description><![CDATA[This is me trying to understand it:
Instead of services that read your feeds (e.g. Google Reader) having to ASK for your feed periodically, now they can instead just wait until YOUR SITE notifies THEM. Basically a &#8220;push&#8221; service. 
It seems to me this is half the equation. The other half is building services that accept [...]]]></description>
			<content:encoded><![CDATA[<p>This is me trying to understand it:</p>
<p>Instead of services that read your feeds (e.g. Google Reader) having to ASK for your feed periodically, now they can instead just wait until YOUR SITE notifies THEM. Basically a &#8220;push&#8221; service. </p>
<p>It seems to me this is half the equation. The other half is building services that accept these push notifications. I&#8217;m not sure who is already doing that, but I wouldn&#8217;t be surprised if Google is on it, since it seems like a more efficient way of doing things on both sides (less server resources on both sides).</p>
<p>Two concerns I can think of:</p>
<ol>
<li>Is this just as reliable as the &#8220;old&#8221; way? People not getting feed updates because of a hiccup in the chain sucks for everyone.</li>
<li>This makes &#8220;accidentally&#8221; hitting that publish button potentially even more embarrassing than it already can be. Like when you <a href="http://digwp.com/2010/03/change-quick-action-button/#comment-3578">accidentally publish a post instead of a page</a>.</li>
</ol>
<p>Also check the <a href="http://code.google.com/p/pubsubhubbub/">overview slideshow here</a>.</p>
<p><small><a href="http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/">Permalink</a> | <a href="http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/&title=PubSubHubbub Now On All WordPress.com sites (+ plugin for self hosted&nbsp;sites)">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/-aQdqjPCW0E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/pubsubhubbub-now-on-all-wordpress-com-sites-plugin-for-self-hosted-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/</feedburner:origLink></item>
		<item>
		<title>Add Link to Favorites Dropdown</title>
		<link>http://feedproxy.google.com/~r/DiggingIntoWordpress/~3/r4E0Fcqj_CM/</link>
		<comments>http://digwp.com/2010/03/add-link-to-favorites-dropdown/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 17:36:06 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://digwp.com/?p=1544</guid>
		<description><![CDATA[This is basically a smarter way to handle the situation I just posted about. Using a function to manipulate the favorites dropdown instead of a core hack.
Direct Link to Article &#8212; Permalink on DiWLike the article? Get the book!

© 2010 Digging into WordPress &#124; Permalink &#124; Comments &#124; Add to
Delicious
Categorized: Links &#124; Tagged: ]]></description>
			<content:encoded><![CDATA[<p>This is basically a smarter way to handle the situation I just posted about. Using a function to manipulate the favorites dropdown instead of a core hack.</p>
<p><small><a href="http://tipsforwordpress.com/wordpress/add-link-to-favorites-drop-down/" title="Direct link to featured article">Direct Link to Article</a> &#8212; <a href="http://digwp.com/2010/03/add-link-to-favorites-dropdown/" title="Permalink to post on DiW">Permalink on DiW</a></small></p><p style="border:1px solid #ccc; background: #eee; line-height: 20px; padding: 5px 10px; margin-top: 10px;">Like the article? <a href="http://digwp.com/book"><strong>Get the book!</strong></a></p>
<hr />
<p><small>© 2010 <a href="http://digwp.com">Digging into WordPress</a> | <a href="http://digwp.com/2010/03/add-link-to-favorites-dropdown/">Permalink</a> | <a href="http://digwp.com/2010/03/add-link-to-favorites-dropdown/#comments">Comments</a> | Add to
<a href="http://del.icio.us/post?url=http://digwp.com/2010/03/add-link-to-favorites-dropdown/&title=Add Link to Favorites&nbsp;Dropdown">Delicious</a><br />
Categorized: <a href="http://digwp.com/category/links/" title="View all posts in Links" rel="category tag">Links</a> | Tagged: </small></p><img src="http://feeds.feedburner.com/~r/DiggingIntoWordpress/~4/r4E0Fcqj_CM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://digwp.com/2010/03/add-link-to-favorites-dropdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tipsforwordpress.com/wordpress/add-link-to-favorites-drop-down/</feedburner:origLink></item>
	</channel>
</rss>
