title: Wordpress get_pages based on page category
body: <p>I need to get_pages or get an array of pages in WP based on it 's category</p>
  
  <p>I know WP doesn't come with categories on pages but I'm using this in the functions.php to get categories on the pages.</p>
  
  <pre><code>    add_action('admin_init', 'reg_tax');
  
      function reg_tax() {
          register_taxonomy_for_object_type('category', 'page');
          add_post_type_support('page', 'category');
      }
  </code></pre>
  
  <p>Now I need to use these categories in get_pages or WP_Query to get in the pages with a category.</p>
  
  <pre><code>     &lt;div class="productNav"&gt;
  
                  &lt;ul&gt;
  
                  &lt;?php
  
                  $product_page_args = array(
  
                      'post_type' =&gt; 'page',
                      'order' =&gt; 'ASC',
                      'orderby' =&gt; 'menu_order',
                      'child_of' =&gt; $post-&gt;ID,
                      'category_name' =&gt; 'pillar-product'
                  );
  
                  //$product_pages = get_pages($product_page_args);
  
                  $product_pages = new WP_Query($product_page_args);
  
  
  
                  foreach ($product_pages as $product_page){  
  
                  ?&gt;
  
                      &lt;li&gt;&lt;?php echo $product_page-&gt;post_title; ?&gt;&lt;/li&gt;    
  
                  &lt;?php
                  }
                  ?&gt;
  
                  &lt;/ul&gt;
  
              &lt;/div&gt;
  </code></pre>