<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Disable widget areas (sidebars) without touching theme templates</title>
	<atom:link href="http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Wed, 23 May 2012 07:51:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Balu</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-524171</link>
		<dc:creator>Balu</dc:creator>
		<pubDate>Mon, 19 Dec 2011 13:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-524171</guid>
		<description>Remove this code from index.php 
 get_sidebar();</description>
		<content:encoded><![CDATA[<p>Remove this code from index.php<br />
 get_sidebar();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-434384</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 30 Sep 2011 04:04:10 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-434384</guid>
		<description>Even better would be to do this in a child theme with its own functions.php file that way you really aren&#039;t editing the theme files at all. Of course you have to stop a tutorial somewhere...</description>
		<content:encoded><![CDATA[<p>Even better would be to do this in a child theme with its own functions.php file that way you really aren&#8217;t editing the theme files at all. Of course you have to stop a tutorial somewhere&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: common set of custom wordpress functions &#171; Niroze&#039;s Weblog</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-411646</link>
		<dc:creator>common set of custom wordpress functions &#171; Niroze&#039;s Weblog</dc:creator>
		<pubDate>Sun, 04 Sep 2011 11:28:33 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-411646</guid>
		<description>[...] Justin Tadlock shares this handy function for removing unwanted widget areas from our theme – a must for customizing existing themes: [...]</description>
		<content:encoded><![CDATA[<p>[...] Justin Tadlock shares this handy function for removing unwanted widget areas from our theme – a must for customizing existing themes: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-396055</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Wed, 10 Aug 2011 19:14:17 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-396055</guid>
		<description>Is it possible to disable all widgets on a per page basis? If so, how? Thanks!</description>
		<content:encoded><![CDATA[<p>Is it possible to disable all widgets on a per page basis? If so, how? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodney Corle</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-336657</link>
		<dc:creator>Rodney Corle</dc:creator>
		<pubDate>Thu, 05 May 2011 16:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-336657</guid>
		<description>Very good blog! Do you have any hints for aspiring writers? I&#039;m planning to start my own site soon but I&#039;m a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I&#039;m totally overwhelmed .. Any suggestions? Appreciate it!</description>
		<content:encoded><![CDATA[<p>Very good blog! Do you have any hints for aspiring writers? I&#8217;m planning to start my own site soon but I&#8217;m a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I&#8217;m totally overwhelmed .. Any suggestions? Appreciate it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric S</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-263484</link>
		<dc:creator>Eric S</dc:creator>
		<pubDate>Tue, 14 Dec 2010 19:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-263484</guid>
		<description>This looks like it is exactly what I need.  Thank you 

I could use some help though /*noob alert*/

Where is the proper place to paste the code that Justin provided at the beginning of this post.  I know it&#039;s in the functions.php file, but where specifically should it be posted.  I see other filters in the file, but every time I paste it, I get an error...

Thanks for your help!</description>
		<content:encoded><![CDATA[<p>This looks like it is exactly what I need.  Thank you </p>
<p>I could use some help though /*noob alert*/</p>
<p>Where is the proper place to paste the code that Justin provided at the beginning of this post.  I know it&#8217;s in the functions.php file, but where specifically should it be posted.  I see other filters in the file, but every time I paste it, I get an error&#8230;</p>
<p>Thanks for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Brown</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-262585</link>
		<dc:creator>Jon Brown</dc:creator>
		<pubDate>Sun, 12 Dec 2010 14:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-262585</guid>
		<description>I can&#039;t get this to work targeting a single widget...  Maybe I&#039;m misreading the post though.  

I can remove a single &quot;widget area&quot;, ie. an entire sidebar, but can&#039;t seem to target individual widgets within a widget area.

This works:

&lt;pre&gt;&lt;code&gt;add_filter (&#039;sidebars_widgets&#039;, &#039;remove_text_widget&#039;);
function remove_text_widget( $sidebars_widgets ){
	if (is_page(15))
		$sidebars_widgets [&#039;sidebar&#039;] = false;
	return $sidebars_widgets;
}&lt;/code&gt;&lt;/pre&gt;

This doesn&#039;t:

&lt;pre&gt;&lt;code&gt;add_filter (&#039;sidebars_widgets&#039;, &#039;remove_text_widget&#039;);
function remove_text_widget( $sidebars_widgets ){
	if (is_page(15))
		$sidebars_widgets [&#039;text-5&#039;] = false;
	return $sidebars_widgets;
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get this to work targeting a single widget&#8230;  Maybe I&#8217;m misreading the post though.  </p>
<p>I can remove a single &#8220;widget area&#8221;, ie. an entire sidebar, but can&#8217;t seem to target individual widgets within a widget area.</p>
<p>This works:</p>
<pre><code>add_filter ('sidebars_widgets', 'remove_text_widget');
function remove_text_widget( $sidebars_widgets ){
	if (is_page(15))
		$sidebars_widgets ['sidebar'] = false;
	return $sidebars_widgets;
}</code></pre>
<p>This doesn&#8217;t:</p>
<pre><code>add_filter ('sidebars_widgets', 'remove_text_widget');
function remove_text_widget( $sidebars_widgets ){
	if (is_page(15))
		$sidebars_widgets ['text-5'] = false;
	return $sidebars_widgets;
}</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-236809</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sat, 09 Oct 2010 22:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-236809</guid>
		<description>Hey Justin, nice trick, by the way, i&#039;m playing with this code i made:

&lt;pre&gt;&lt;code&gt;$sidebars_widgets = get_option(&#039;sidebars_widgets&#039;);
foreach ($sidebars_widgets as $index=&gt;$widgets) {
	if ($index!=&#039;wp_inactive_widgets&#039; &amp;&amp; $index!=&#039;array_version&#039;) {
		if(!empty($widgets) ){
			foreach($widgets as $n){
				echo &#039;Widgets in use: &#039;.$n.&#039;&#039;;
			}
		}
	}
	if($index==&#039;wp_inactive_widgets&#039;){
			foreach($widgets as $n){
				echo &#039;Widgets inactive: &#039;.$n.&#039;&#039;;
			}
	}
}&lt;/code&gt;&lt;/pre&gt;

There you can see i&#039;m able to get all active and inactive widgets, not the widgets areas, each widget id.

So, then i can run a single &lt;code&gt;wp_unregister_sidebar_widget([some_id]);&lt;/code&gt; to disable any widget from any page or post. 

But, i can&#039;t figure how to do the reverse thing, i mean to register dinamicly one of the inactive ones in a certain widget area. 

Got what i mean?

Well, that&#039;s it, you have my email, pleas reply if you found how to. Thanks.</description>
		<content:encoded><![CDATA[<p>Hey Justin, nice trick, by the way, i&#8217;m playing with this code i made:</p>
<pre><code>$sidebars_widgets = get_option('sidebars_widgets');
foreach ($sidebars_widgets as $index=&gt;$widgets) {
	if ($index!='wp_inactive_widgets' &amp;&amp; $index!='array_version') {
		if(!empty($widgets) ){
			foreach($widgets as $n){
				echo 'Widgets in use: '.$n.'';
			}
		}
	}
	if($index=='wp_inactive_widgets'){
			foreach($widgets as $n){
				echo 'Widgets inactive: '.$n.'';
			}
	}
}</code></pre>
<p>There you can see i&#8217;m able to get all active and inactive widgets, not the widgets areas, each widget id.</p>
<p>So, then i can run a single <code>wp_unregister_sidebar_widget([some_id]);</code> to disable any widget from any page or post. </p>
<p>But, i can&#8217;t figure how to do the reverse thing, i mean to register dinamicly one of the inactive ones in a certain widget area. </p>
<p>Got what i mean?</p>
<p>Well, that&#8217;s it, you have my email, pleas reply if you found how to. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Tadlock</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-224028</link>
		<dc:creator>Justin Tadlock</dc:creator>
		<pubDate>Sat, 21 Aug 2010 11:53:16 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-224028</guid>
		<description>Because you can&#039;t disable sidebars with the Widget Logic plugin.</description>
		<content:encoded><![CDATA[<p>Because you can&#8217;t disable sidebars with the Widget Logic plugin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody</title>
		<link>http://justintadlock.com/archives/2009/03/06/disable-widget-areas-without-touching-theme-templates#comment-223971</link>
		<dc:creator>Cody</dc:creator>
		<pubDate>Sat, 21 Aug 2010 07:08:21 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1495#comment-223971</guid>
		<description>Hey, why not use the widget logic plugin?</description>
		<content:encoded><![CDATA[<p>Hey, why not use the widget logic plugin?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

