Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: How do I list the Child Posts on a Parent Post's template (single and archive)?

$
0
0

I've figured out the code. This is what I have in my template and it works!

<?php $childargs = array(
			'post_type' => 'products',
			'numberposts' => -1,
			'orderby' => 'post_id',
			'order' => 'ASC',
			'meta_query' => array(array('key' => '_wpcf_belongs_manufacturer_id', 'value' => get_the_ID()))
			);
$my_query = new WP_Query($childargs);
  while ($my_query->have_posts()) : $my_query->the_post();
   <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  <?php endwhile; ?>

Viewing all articles
Browse latest Browse all 20145

Trending Articles