Display two particular categories on one page
-
Hi, I am using the following code in a page template to show a particular category on a page. I would like to add a second category to this page template, so that posts from both will display on the page. How would I do so?
<?php // page id 364 video & audio will get category ID 39 video posts and 52 audio posts if (is_page('364') ) { $cat = array(39); } $showposts = -1; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( 'category__in' => $cat, 'showposts' => $showposts, 'caller_get_posts' => $do_not_show_stickies ); $my_query = new WP_Query($args); ?> <?php if( $my_query->have_posts() ) : ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php //necessary to show the tags global $wp_query; $wp_query->in_the_loop = true; ?>
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display two particular categories on one page’ is closed to new replies.