I need to select posts that belong in TWO categories.
How do I add “category__and” into this code?
Please help!
[php]function excerptlist_func($atts) {
extract(shortcode_atts(array(
‘titleonly’ => ‘n’,
‘cat’ => ‘’,
‘num’ => 5,
‘offset’ => ‘’,
), $atts));
$args = array('posts_per_page' => $num, 'offset' => $offset );
$id = get_cat_id($cat);
$args['cat'] = $id;
$loop = new WP_Query( $args );
$posts = array();
foreach($loop->posts as $p) { $posts[] = $p; }
global $post;
$opost = $post;
ob_start();[/php]