title: query only page children, on page.php
body: <p>I'm making a custom query in wordpress to retrieve child pages of page ID #20 only.</p>
  
  <p>And only to be visible on pages with the ID <strong>#20</strong>, <strong>#95</strong> and <strong>#97</strong></p>
  
  <pre><code>&lt;?php if (is_page(array('20','95','97'))) /* RIDERS */ { query_posts(array(
  
      'post_type' =&gt; 'page',
  
      'child_of' =&gt; 20,
  
      'order' =&gt; 'DESC'
  
  )); } ?&gt;
  
  &lt;?php if ( have_posts()) : while (have_posts()) : the_post(); ?&gt;
  
      &lt;!-- my loop stuff here --&gt;          
  
  &lt;?php endwhile; endif; wp_reset_query(); ?&gt;
  </code></pre>
  
  <p>My first problem is that this loop is on my page.php template file (outside main page loop). And for some reason the page data is being displayed in my query above. How can I tighten this query above so it does not interfere with other loops on the page. I think it's because I have 2 <code>&lt;?php if ( have_posts()) : while (have_posts()) : the_post(); ?&gt;</code> on my page.php template.</p>
  
  <p>My next question is, have I wrote this query right? As it seems to list other pages than just the children pages of page id #20?</p>
  
  <p>Many Thanks for you help.</p>
  
  <p>Josh</p>