<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: Removing sidebar on child pages</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Thu, 20 Jun 2013 02:52:10 +0000</pubDate>

<item>
<title>sunlamp on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5513</link>
<pubDate>Sun, 02 Aug 2009 21:31:25 +0000</pubDate>
<dc:creator>sunlamp</dc:creator>
<guid isPermaLink="false">5513@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Thanks all! &#60;/p&#62;
&#60;p&#62;Chris's suggestion solved it.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function remove_sidebar() {
    global $post;
	// We test if we are on the page &#38;#39;Visualizations&#38;#39;
	if ( is_page(&#38;#39;Visualizations&#38;#39;) &#124;&#124; $post-&#38;gt;post_parent == &#38;#39;5&#38;#39; ) {
    // the page is &#38;quot;Visualizations&#38;quot;, or the parent of the page is &#38;quot;Visualizations&#38;quot;

		// Yes, we are .. now we switch off the sidebar
		return FALSE;
	} else {
		// we are not .. we leave the switch on
		return TRUE;
	}
}
// Connect the filter to thematic_sidebar()
add_filter(&#38;#39;thematic_sidebar&#38;#39;, &#38;#39;remove_sidebar&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And then I also used this in style.css to widen the content areas on all the child pages of parent page id=5&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;body.parent-pageid-5 #container {
	width: 960px;
}

body.parent-pageid-5 #content {
	width: 940px;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks again&#60;br /&#62;
david
&#60;/p&#62;</description>
</item>
<item>
<title>Chris on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5506</link>
<pubDate>Sun, 02 Aug 2009 18:31:58 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid isPermaLink="false">5506@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;You can't use one of the globals without defining it.&#60;/p&#62;
&#60;p&#62;global $post;&#60;/p&#62;
&#60;p&#62;at the beginning of your function should resolve it.&#60;/p&#62;
&#60;p&#62;Chris&#60;br /&#62;
- still one week on vacation
&#60;/p&#62;</description>
</item>
<item>
<title>amygail on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5505</link>
<pubDate>Sun, 02 Aug 2009 18:07:08 +0000</pubDate>
<dc:creator>amygail</dc:creator>
<guid isPermaLink="false">5505@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;If you can't find an answer another option is to make a custom page template with no sidebars and use that.&#60;/p&#62;
&#60;p&#62;You an also hide sidebars via css - but that's kind of cluncky
&#60;/p&#62;</description>
</item>
<item>
<title>dok_deleon on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5503</link>
<pubDate>Sun, 02 Aug 2009 16:01:07 +0000</pubDate>
<dc:creator>dok_deleon</dc:creator>
<guid isPermaLink="false">5503@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I'm no php ninja myself, but this might help you... &#60;a href=&#34;http://brams.dk/public/wp/tbr_article_family.zip&#34;&#62;tbr_article_family&#60;/a&#62;&#60;br /&#62;
all you need to do is install and activate this plugin and use tbr_is_decendant_of(&#34;place page id here&#34;) for testing for subpages (and grandchildren). &#60;/p&#62;
&#60;p&#62;so this would make:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
function remove_sidebar() {&#60;br /&#62;
	// We test if we are on the page 'Visualization, with an example page ID of 4'&#60;br /&#62;
	if ( is_page('Visualizations') &#124;&#124; tbr_is_decendant_of(4)) {&#60;br /&#62;
    // the page is &#34;Visualizations&#34;, or the parent of the page is &#34;Visualizations&#34;&#60;/p&#62;
&#60;p&#62;		// Yes, we are .. now we switch off the sidebar&#60;br /&#62;
		return FALSE;&#60;br /&#62;
	} else {&#60;br /&#62;
		// we are not .. we leave the switch on&#60;br /&#62;
		return TRUE;&#60;br /&#62;
	}&#60;br /&#62;
}&#60;br /&#62;
// Connect the filter to thematic_sidebar()&#60;br /&#62;
add_filter('thematic_sidebar', 'remove_sidebar');&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;hope this helps :D
&#60;/p&#62;</description>
</item>
<item>
<title>awarner20 on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5499</link>
<pubDate>Sun, 02 Aug 2009 13:15:47 +0000</pubDate>
<dc:creator>awarner20</dc:creator>
<guid isPermaLink="false">5499@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Not certain how it could be used in your code, but there is the child_of parameter for wp_list_pages. &#60;/p&#62;
&#60;p&#62;&#60;code&#62;wp_list_pages(&#38;quot;title_li=&#38;#38;child_of=$id&#38;#38;show_date=modified&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>sunlamp on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5498</link>
<pubDate>Sun, 02 Aug 2009 12:54:49 +0000</pubDate>
<dc:creator>sunlamp</dc:creator>
<guid isPermaLink="false">5498@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Amy&#60;/p&#62;
&#60;p&#62;Thanks for your help.&#60;/p&#62;
&#60;p&#62;I customised the code with the Conditional Tags on the page you suggested. &#60;/p&#62;
&#60;p&#62;Now I've managed to remove the sidebar from the parent page, but not from any of its children. Is there something I'm doing wrong?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// remove sidebar for certain pages
// &#60;a href=&#34;http://www.wupperpiraten.de/2009/03/how-to-remove-the-sidebar-from-a-certain-page/&#34; rel=&#34;nofollow&#34;&#62;http://www.wupperpiraten.de/2009/03/how-to-remove-the-sidebar-from-a-certain-page/&#60;/a&#62;
// filter thematic_sidebar() .. no display for the page &#38;#39;Visualizations&#38;#39; &#38;#38; its children

function remove_sidebar() {
	// We test if we are on the page &#38;#39;Visualization&#38;#39;
	if ( is_page(&#38;#39;Visualizations&#38;#39;) &#124;&#124; $post-&#38;gt;post_parent == &#38;#39;5&#38;#39; ) {
    // the page is &#38;quot;Visualizations&#38;quot;, or the parent of the page is &#38;quot;Visualizations&#38;quot;

		// Yes, we are .. now we switch off the sidebar
		return FALSE;
	} else {
		// we are not .. we leave the switch on
		return TRUE;
	}
}
// Connect the filter to thematic_sidebar()
add_filter(&#38;#39;thematic_sidebar&#38;#39;, &#38;#39;remove_sidebar&#38;#39;);

?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>amygail on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5494</link>
<pubDate>Sat, 01 Aug 2009 19:41:32 +0000</pubDate>
<dc:creator>amygail</dc:creator>
<guid isPermaLink="false">5494@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I've not attempted this myself - but maybe there's an answer for you here&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://codex.wordpress.org/Conditional_Tags&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Conditional_Tags&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;scroll down to:&#60;/p&#62;
&#60;p&#62;&#34;Testing for sub-Pages&#34;
&#60;/p&#62;</description>
</item>
<item>
<title>sunlamp on "Removing sidebar on child pages"</title>
<link>http://themeshaper.com/forums/topic/removing-sidebar-on-child-pages#post-5487</link>
<pubDate>Sat, 01 Aug 2009 09:13:53 +0000</pubDate>
<dc:creator>sunlamp</dc:creator>
<guid isPermaLink="false">5487@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi there&#60;/p&#62;
&#60;p&#62;I'm finding the 'Removing the Sidebar' code snippet at the Code Bar very helpful&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.wupperpiraten.de/2009/03/how-to-remove-the-sidebar-from-a-certain-page/&#34;&#62;http://www.wupperpiraten.de/2009/03/how-to-remove-the-sidebar-from-a-certain-page/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;However my PHP isn't up to much.&#60;/p&#62;
&#60;p&#62;Can anyone suggest how I can make this code work to remove the sidebars from all the child pages of a given page?&#60;/p&#62;
&#60;p&#62;Thanks for your help!&#60;/p&#62;
&#60;p&#62;david
&#60;/p&#62;</description>
</item>

</channel>
</rss>
