<?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: frustration with wp_list_pages</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Fri, 24 May 2013 15:12:26 +0000</pubDate>

<item>
<title>krowchuk on "frustration with wp_list_pages"</title>
<link>http://themeshaper.com/forums/topic/frustration-with-wp_list_pages#post-17045</link>
<pubDate>Tue, 16 Nov 2010 16:20:31 +0000</pubDate>
<dc:creator>krowchuk</dc:creator>
<guid isPermaLink="false">17045@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi!&#60;/p&#62;
&#60;p&#62;I am retooling my theme, was using a customized Kubrick and am now trying to recode it to use a child theme under thematic.  I've actually managed to figure most stuff out but am currently stuck at this point.&#60;/p&#62;
&#60;p&#62;On my current theme I have a page with subpages under it. On the top level page I have a list of all the subpages. I hardcoded this onto a custom template using code I found on the codex, and it works great.&#60;/p&#62;
&#60;p&#62;I'm having a problem moving the code over to thematic.&#60;/p&#62;
&#60;p&#62;Here is the code on my current site, that works.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
  if($post-&#38;gt;post_parent)
  $children = wp_list_pages(&#38;quot;title_li=&#38;#38;child_of=&#38;quot;.$post-&#38;gt;post_parent.&#38;quot;&#38;#38;echo=0&#38;quot;);
  else
  $children = wp_list_pages(&#38;quot;title_li=&#38;#38;child_of=&#38;quot;.$post-&#38;gt;ID.&#38;quot;&#38;#38;echo=0&#38;quot;);
  if ($children) { ?&#38;gt;
  &#38;lt;ul&#38;gt;
  &#38;lt;?php echo $children; ?&#38;gt;
  &#38;lt;/ul&#38;gt;
  &#38;lt;?php } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;On my current theme it only shows a list of the parent page and the children pages, but on thematic it shows a list of every page on my site?&#60;/p&#62;
&#60;p&#62;For thematic I wrote this code in functions.php&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Add child page list

function childnav() {
?&#38;gt;

&#38;lt;div id=&#38;quot;articles&#38;quot;&#38;gt;
  &#38;lt;ul&#38;gt;
    &#38;lt;h2&#38;gt;Training Articles by Chris Krowchuk&#38;lt;/h2&#38;gt;

&#38;lt;?php
  if($post-&#38;gt;post_parent)
  $children = wp_list_pages(&#38;quot;title_li=&#38;#38;child_of=&#38;quot;.$post-&#38;gt;post_parent.&#38;quot;&#38;#38;echo=0&#38;quot;);
  else
  $children = wp_list_pages(&#38;quot;title_li=&#38;#38;child_of=&#38;quot;.$post-&#38;gt;ID.&#38;quot;&#38;#38;echo=0&#38;quot;);
  if ($children) { ?&#38;gt;
  &#38;lt;ul&#38;gt;
  &#38;lt;?php echo $children; ?&#38;gt;
  &#38;lt;/ul&#38;gt;
  &#38;lt;?php } ?&#38;gt;

  &#38;lt;/ul&#38;gt;
&#38;lt;/div&#38;gt;&#38;lt;!--end articles --&#38;gt;

&#38;lt;?php
}
add_action(&#38;#39;thematic_belowpost&#38;#39;, &#38;#39;childnav&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;What i would like to accomplish is to have this list of child pages only occur on pages that have children, or are children -&#38;gt; and to only show the parent and the children pages in the list.  Is this possible without using and assigning a special page template to those pages? I'm not even sure how one would do that with thematic.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
