<?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>Quacktacular Media &#187; WordPress</title>
	<atom:link href="http://quacktacular.net/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://quacktacular.net</link>
	<description>Not just another duck in the pond</description>
	<lastBuildDate>Thu, 17 Nov 2011 07:22:57 +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>Dynamic Sidebars</title>
		<link>http://quacktacular.net/2009/01/dynamic-sidebars/</link>
		<comments>http://quacktacular.net/2009/01/dynamic-sidebars/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 05:45:42 +0000</pubDate>
		<dc:creator>Brendan</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://quacktacular.net/?p=332</guid>
		<description><![CDATA[If you use WordPress as a CMS, or just want to customize your sidebar per-page, then there is a solution for you. I&#8217;ve spent a long time looking for a way to show only the sidebar content I want on &#8230; <a href="http://quacktacular.net/2009/01/dynamic-sidebars/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-333" title="widgetlogic" src="http://quacktacular.net/wp-content/uploads/2009/01/picture-3.png" alt="widgetlogic" width="134" height="125" /></p>
<p>If you use WordPress as a CMS, or just want to customize your sidebar per-page, then there is a solution for you. I&#8217;ve spent a long time looking for a way to show only the sidebar content I want on each page. For example; I might like to show the latest news on the home page, helpful links on a resources page and photo thumbnails to add interest to an About page.</p>
<p>Up until now I&#8217;ve been using the K2 Sidebar Manger. Its worked well in practice, but is buggy, unsupported by some widgets and is now discontinued. The replacement I found is something called <a href="http://wordpress.org/extend/plugins/widget-logic/">Widget Logic</a>. It uses exceeding powerful <a href="http://codex.wordpress.org/Conditional_Tags">conditional tags</a> built into WordPress and allows  you choose where you want specific widgets to show up. It is a little difficult to setup at first, and you&#8217;ll need to familiarize yourself with the proper syntax. Here are some examples that you can use once you install the plugin.</p>
<p><span id="more-332"></span><strong>1) We&#8217;ll start by showing a widget on one page only.</strong></p>
<p style="padding-left: 30px;"><em>is_page(&#8216;About&#8217;)</em></p>
<p>That&#8217;s all you need to place in the <em>Widget Logic</em> box. The code is actually quite intuitive, you just specify which page you would like to show the content on. This will show the widget on any page called About. You could also use the page&#8217;s ID number.</p>
<p><strong>2) Now lets show the Latest posts on a static home page, the blogs index and on single blog posts. </strong></p>
<p style="padding-left: 30px;"><em>(is_page(&#8216;Home&#8217;) || is_home() ||  is_single())</em></p>
<p> Same idea, but wrapped in parentheses where &#8221;||&#8221; represents &#8220;or&#8221; to WordPress.</p>
<p><strong>3) You could also show text on any given pages. In this example I included text on a page and all of its child pages.</strong></p>
<p style="padding-left: 30px;"><em>global $post; return (is_page(&#8216;Society&#8217;) || $post-&gt;post_parent==&#8221;26&#8243;);</em></p>
<p>The &#8220;global $post; return&#8221; section is necessary because the conditional tags don&#8217;t officailly support child pages yet. &#8220;Society&#8221; is the parent page and &#8220;26&#8243; is that page&#8217;s ID. When we place this code in the <em>Widget Logic</em> box, &#8220;Society&#8221; and all of its children will show the widget you&#8217;re working with.</p>
<p>Hopefully the fine people at WordPress can cook up something a little more smooth, but in the mean time we have a very functional way to show page specific widgets. If you have any questions about Widget Logic, or need some help with syntax, I&#8217;ll do my best to answer in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://quacktacular.net/2009/01/dynamic-sidebars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

