0, 'post_type' => 'post', 'num' => 5, 'excerpt' => false, 'thumbnail' => false, 'thumb_size' => 'thumbnail', 'title_pos' => 'after_thumb', 'date' => false, 'cat' => false, 'exclude_cat' => false, 'tag' => false, 'exclude_tag' => false), $atts)); $args = array( 'post_status' => 'publish', 'orderby' => 'post_date', 'post_type' => $post_type, 'posts_per_page' => $num ); if ($cat != false) { $cats = explode($cat); $cat_select = 'category__in'; if ($exclude_cat != false) { $cat_select = 'category__not_in'; } $args[$cat_select] = $cats; } if ($tag != false) { $tags = explode($tag); $cat_select = 'tag__in'; if ($exclude_tag != false) { $tag_select = 'tag__not_in'; } $args[$tag_select] = $tags; } $posts = new WP_Query($args); $i = 0; if ($posts->have_posts()){ while ($posts->have_posts()){ $posts->the_post(); ?>