<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<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"
		>
	<channel>
		<title>WordPress Ideas &#187; Tag: sub-pages - Recent Posts</title>
		<link>http://wordpress.org/ideas/tags/sub-pages</link>
		<description>WordPress Ideas &#187; Tag: sub-pages - Recent Posts</description>
		<language>en-US</language>
		<pubDate>Wed, 19 Jun 2013 19:43:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://wordpress.org/ideas/rss/tags/sub-pages" rel="self" type="application/rss+xml" />

		<item>
			<title>Povilas on "Add is_tree function to core of WordPress"</title>
			<link>http://wordpress.org/ideas/topic/add-is_tree-function-to-core-of-wordpress#post-17378</link>
			<pubDate>Wed, 30 Jun 2010 18:56:50 +0000</pubDate>
			<dc:creator>Povilas</dc:creator>
			<guid isPermaLink="false">17378@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>My first impression was that syncbox is right.<br />
Then I remembered one recent project and some solutions in it. It was sort of a news portal, but it also has a lot of static pages (by static I mean Pages, not Posts).<br />
There was actually a lot of pages dedicated to services there (services was also mentioned by syncbox). At first I was trying something along the is_tree() philosophy. Then bad things happened. For your information the structural representation of the tree I had to build:</p>
<p>Services (top level page)<br />
- Service group 1 (second lvl)<br />
-- Service group 1.1 (third lvl)<br />
--- Service 1.1.1 (4th lvl)<br />
--- Service 1.1.2 (4th lvl)<br />
--- Service 1.1.3 (4th lvl)<br />
-- Service group 1.2 (third lvl)<br />
--- Service 1.2.1 (4th lvl)<br />
--- Service 1.2.2 (4th lvl)<br />
-- Service 1.2 (third lvl)<br />
-- Service 1.3 (third lvl)<br />
- Service group 2 (second lvl)<br />
- Service group 3 (second lvl)<br />
- Service group 4 (second lvl)</p>
<p>So the bad things here:<br />
1. Layouts: top level service page, second level service group page, third level service group page and a separate service (no matter what level) page had its own layout<br />
2. Structure: service groups have minor service groups. Still, both, minor and major, groups can have their own services.</p>
<p>The thing here is that _I could have_ used is_tree() if I only had service groups that have services, but if the structure is complex, it is useless and produces a lot of code and if. Hence I went the simple way: I made different page templates and let the user set them. It is much more dynamic that way and requires no coding at all - copy the structure, reshape it and produce another layout.</p>
<p>I don't vote :)
</p>]]></description>
					</item>
		<item>
			<title>Chris Wetzel on "Add is_tree function to core of WordPress"</title>
			<link>http://wordpress.org/ideas/topic/add-is_tree-function-to-core-of-wordpress#post-16701</link>
			<pubDate>Mon, 12 Apr 2010 19:09:31 +0000</pubDate>
			<dc:creator>Chris Wetzel</dc:creator>
			<guid isPermaLink="false">16701@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>syncbox</p>
<p>Your passionate advocacy of is_tree sounded just like what i needed to fix my submenu problem... but I can't get it to work *&#38;%$#(@! Can you or someone help me? Newbee Wordpress guy.</p>
<p>I have a double scissor-type drop menu, that wouldn't work with wp-list pages so I'm hardcodeing my navigation. You can see it here at <a href="http://wereorganized.biz/" rel="nofollow">http://wereorganized.biz/</a>.</p>
<p>I pasted the is_tree function(exacty as from your post) into my functions.php, then added this to the list item that contained the nested unordered list of my submenu:</p>
<p>&#60;li&#60;?php if (is_tree('garage-cabinets')) { echo " class=\"current\""; } ?&#62;&#62;<a href="garage-cabinets">&#60;b&#62;GARAGE CABINETS&#60;/b&#62;</a></p>
<p>I was expecting the "current" class to be added to any submenu li of garage cabinets, what I got was this error:<br />
Fatal error: Call to undefined function is_tree() in /home/content/77/5846477/html/wp-content/themes/modern-style/header.php  on line 57</p>
<p>Can you give me a clue as to what I'm doing wrong?
</p>]]></description>
					</item>
		<item>
			<title>syncbox on "Add is_tree function to core of WordPress"</title>
			<link>http://wordpress.org/ideas/topic/add-is_tree-function-to-core-of-wordpress#post-16511</link>
			<pubDate>Tue, 30 Mar 2010 20:52:35 +0000</pubDate>
			<dc:creator>syncbox</dc:creator>
			<guid isPermaLink="false">16511@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>You don't get the value of it or what? Let's say you want to use a specific sidebar file or include ONLY for the pages under your "services" section, in which "services" is the parent of all the sub-pages of types of services... Or, you only want some information to appear in the sidebar.php file IF the browser is displaying a sub-page of "services" (there are many scenarios)</p>
<p>The ability to say if (is_tree('services')) {//do whatever} else {//do something else} means that ANY NEW pages you add under services (but NOT sub-sub-pages) will trigger whatever instructions you provide when a sub-page of services is displayed.</p>
<p>Does that help? Rather than having to declared all existing pages and give the instructions and hope that no new pages are added... you can account for any new pages via the is_tree() function.</p>
<p>Why should it have to be added to the functions.php file when it could simply BE in the core functions and ready to roll?</p>
<p>My two. HTH
</p>]]></description>
					</item>
		<item>
			<title>Jen Mylo on "Separate posts for separate pages"</title>
			<link>http://wordpress.org/ideas/topic/separate-posts-for-separate-pages#post-15241</link>
			<pubDate>Thu, 25 Feb 2010 01:37:50 +0000</pubDate>
			<dc:creator>Jen Mylo</dc:creator>
			<guid isPermaLink="false">15241@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>This is theme territory.
</p>]]></description>
					</item>
		<item>
			<title>alexglewis on "Separate posts for separate pages"</title>
			<link>http://wordpress.org/ideas/topic/separate-posts-for-separate-pages#post-14091</link>
			<pubDate>Mon, 16 Nov 2009 01:56:58 +0000</pubDate>
			<dc:creator>alexglewis</dc:creator>
			<guid isPermaLink="false">14091@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I don't really follow. If you intend to display the content of sub-pages on one page, why not just put the content on the parent page in the first place? Similarly, if you want to use subpages to post content in a time-dependent way, why not just add a Loop for a particular category?</p>
<p>Could you elaborate on why you'd want to display subpages on the parent page?
</p>]]></description>
					</item>
		<item>
			<title>phoenixis on "Separate posts for separate pages"</title>
			<link>http://wordpress.org/ideas/topic/separate-posts-for-separate-pages#post-14079</link>
			<pubDate>Sun, 15 Nov 2009 01:22:09 +0000</pubDate>
			<dc:creator>phoenixis</dc:creator>
			<guid isPermaLink="false">14079@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>On my blog, there are several pages. The page names appear just under the header and if there are sub-pages, they appear in a drop down menu. </p>
<p>I'd like to see something that would allow me to nix the drop-down menu in favour of having the sub-pages appear directly underneath the content of the page. So, when you'd click on the page name, scrolling down you'd first see the page content and then as you kept scrolling, you'd see the content of the sub-pages, organized just the way entry follows entry on the blog side of things.
</p>]]></description>
					</item>
		<item>
			<title>syncbox on "Add is_tree function to core of WordPress"</title>
			<link>http://wordpress.org/ideas/topic/add-is_tree-function-to-core-of-wordpress#post-13321</link>
			<pubDate>Mon, 07 Sep 2009 17:12:40 +0000</pubDate>
			<dc:creator>syncbox</dc:creator>
			<guid isPermaLink="false">13321@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>is_tree() offers a way to affect all the subpages of any page dynamically. For example, you can set styles or includes or whatever without stating the (future and therefore unknown) page numbers.</p>
<p>You can read about this here:<br />
<a href="http://codex.wordpress.org/Conditional_Tags" rel="nofollow">http://codex.wordpress.org/Conditional_Tags</a></p>
<p>Scroll down to Snippet #4.</p>
<p>Here's the function, but you have to add it to use it, since it ISN'T built-in.</p>
<pre><code>function is_tree($pid) {      // $pid = The ID of the page we&#39;re looking for pages underneath
	global $post;         // load details about this page
	if(is_page()&#38;&#38;($post-&#62;post_parent==$pid&#124;&#124;is_page($pid)))
               return true;   // we&#39;re at the page or at a sub page
	else
               return false;  // we&#39;re elsewhere
};</code></pre>]]></description>
					</item>

	</channel>
</rss>
