Nested Loop with custom Field
-
So what i want to be able to do is create a post that pulls multiple children posts into it using tagging or taximony and nested loops. Using the WordPress Codex I have found the basic setup that works:
<ul> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <li> <?php $my_query = new WP_Query( "tag=CUSTOM_TAG" ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); the_content(); } } wp_reset_postdata(); ?> </li> <?php endwhile; ?> <?php endif; ?> </ul>
The only problem is that TAG is static. When I create a new Parent post, i would like to create my own custom tag/taximony per post and asign that tag/taximony to any other child post i would like included under the parent post. Anyone have any ideas?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Nested Loop with custom Field’ is closed to new replies.