Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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; ?>
share|improve this question
    
if i understand rightly that you want to show the articles of the category 'Now Showing' only - have you tried: $args = array( 'post_type' => 'movies', 'paged'=>$paged, 'category__in' => array(6) ); codex.wordpress.org/Function_Reference/… –  Michael May 17 '11 at 16:41
    
Hello Michael, What you sent above did not quite do the trick. No posts are showing up at all. You are correct in what it is I am trying to accomplish though. "I want to ONLY show the category "Now Showing" Please see this page for a better idea...moxidesign.com/dev_chad/now-showing –  Monique Anderson May 17 '11 at 17:18
add comment

1 Answer

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/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.