<?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>RLM &#187; Sidebar Stuff</title>
	<atom:link href="http://www.rlmseo.com/blog/category/wordpress/sidebar-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rlmseo.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 03:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Multiple WordPress Sidebars with get_sidebar()</title>
		<link>http://www.rlmseo.com/blog/multiple-wordpress-sidebars-with-get_sidebar/</link>
		<comments>http://www.rlmseo.com/blog/multiple-wordpress-sidebars-with-get_sidebar/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:42:09 +0000</pubDate>
		<dc:creator>jcrens8392</dc:creator>
				<category><![CDATA[Sidebar Stuff]]></category>
		<category><![CDATA[get_sidebar]]></category>
		<category><![CDATA[multiple sidebars]]></category>
		<category><![CDATA[sidebar]]></category>

		<guid isPermaLink="false">http://www.rlmseo.com/?p=299</guid>
		<description><![CDATA[In this article I show you how to use the get_sidebar() function to call multiple sidebars (as many as you want) in your WordPress theme.]]></description>
			<content:encoded><![CDATA[<div id="attachment_1258" class="wp-caption aligncenter" style="width: 563px"><a href="http://www.rlmseo.com/wp-content/uploads/2009/10/wordpress-multiple-sidebars.jpg" rel="wp-prettyPhoto[299]"><img class="size-full wp-image-1258" title="WordPress Multiple Sidebars" src="http://www.rlmseo.com/wp-content/uploads/2009/10/wordpress-multiple-sidebars.jpg" alt="WordPress Multiple Sidebars" width="553" height="174" /></a><p class="wp-caption-text">Example of using multiple sidebars in WordPress</p></div>
<p>If you&#8217;ve been theming WordPress for a bit you may have come across the need for multiple sidebars, but you may have also realized that the default method of including a sidebar, using the <span class="code">get_sidebar()</span> function, only allows you to include a single sidebar named <span class="code">sidebar.php</span> (without using parameters). There&#8217;s one obvious way to include a sidebar and that&#8217;s by using a standard php include like so:</p>
<p><span id="more-299"></span></p>
[php]include(&#8216;TEMPLATEPATH . &#8216;/right-sidebar.php&#8217;;[/php]
<p>This method works, but in the interest of keeping our code readable and simplifying the inclusion of multiple sidebars, there&#8217;s an easier way to do this and it&#8217;s incredibly simple.</p>
<h2>Including sidebar-left.php and sidebar-right.php using get_sidebar</h2>
<p>Let&#8217;s say we&#8217;ve got two sidebars, right and left, and we&#8217;ll name the files <span class="code">sidebar-right.php</span> and <span class="code">sidebar-left.php</span> respectively. To include those files, all we have to do is use the get_sidebar function but add parameters to each function call to tell WordPress which sidebar we want included where.</p>
<p>To include the file &#8220;sidebar-right.php&#8221; we&#8217;ll use:<br />
[php]get_sidebar(&#8216;right&#8217;);[/php]
<p>And to include our other sidebar, &#8220;sidebar-left.php&#8221; we&#8217;ll use:<br />
[php]get_sidebar(&#8216;left&#8217;);[/php]
<p>Likewise, if we want to include a third sidebar, sidebar-right-2.php for example, we&#8217;ll use:<br />
[php]get_sidebar(&#8216;right-2&#8242;);[/php]
<h2>Syntax of get_sidebar()</h2>
<p>It&#8217;s that simple. The key to remember here is that, as commentator <a href="http://www.kamruti.net/" rel="nofollow">Rakeshkumar Mehta</a> points out, the get_sidebar function prepends &#8220;sidebar- to the argument you feed it, so all your sidebar files should start with &#8220;sidebar-&#8221;. For example, to include a file named <span class="code">sidebar-newsidebar.php</span>, use <span class="code">get_sidebar(&#8216;newsidebar&#8217;)</span>, or to include a file named <span class="code">sidebar-my_right_sidebar.php</span>, use <span class="code">get_sidebar(&#8216;my_right_sidebar&#8217;)</span>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rlmseo.com/blog/multiple-wordpress-sidebars-with-get_sidebar/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

