How do I get the child category posts from a custom post type?

I have a Custom Post Type called “Movies” with 2 categories called “Now Showing” (cat id=6), and “Coming Soon” (cat id=7)

I am trying to alter the code to only pull in the child category for two separate pages, instead of ALL of the posts within the custom post type.

Here is the code I am trying to change: (Any help would be great!)

            <h3 class="section-title">Now Showing</h3>

            <?php
            $args = array( 'post_type' => 'movies', 'paged'=>$paged );
            $loop = new WP_Query( $args );
            $i = 1;

            while ( $loop->have_posts() ) : $loop->the_post(); ?>

                <?php include( TEMPLATEPATH . '/includes/show-movies.php' ); ?>

            <?php endwhile; ?>

1 Answer
1

For the Now showing add 'cat' => 6 to the query array like so:

    $args = array( 'post_type' => 'movies', 'paged'=>$paged ,'cat' => 6);

and for the Coming Soon add 'cat' => 7 so:

    $args = array( 'post_type' => 'movies', 'paged'=>$paged ,'cat' => 7);

but from what i can see you got it working:

http://www.moxidesign.com/dev_chad/movie_category/coming-soon/

http://www.moxidesign.com/dev_chad/movie_category/now-showing/

Leave a Comment