Using new WP_Query in shortcode in a custom field causes the main post content to not display
You’re using get_posts which returns an array of posts, which you can loop through using foreach, but not the_loop. Try this version of the code: function ia_news_display_test($atts){ // [ia_news cat=”category” num=’numbertodisplay’] extract(shortcode_atts(array( ‘cat’ => ‘any’, ‘num’ => ‘2’, ), $atts)); $dirloop = new WP_Query( array( ‘post_type’ => ‘ia_news’, ‘category_name’ => $cat, ‘posts_per_page’ => $num, ‘orderby’ … Read more