How to display specific ids of posts using wp_query?

this is a fairly broad question since there are multiple solutions depending on your exact needs. My method might involve:

  • Setup normal ‘Loop’
  • in each iteration grab the featured image using: wp_get_attachment_image_src( get_post_thumbnail_id( post->ID ), ‘large’ );
  • build an unordered list of images
  • Use a plugin that works with UL listitems to generated a slideshow with the desired features

That’s pretty much it. Can’t test this but might end up looking like:

$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
    echo '<div class="flexslider"><ul class="slides">'; 
    while ( $the_query->have_posts() ) {
         $the_query->the_post();
         echo '<li><img src="' . wp_get_attachment_image_src( get_post_thumbnail_id( post->ID ), 'large' ) . '" /></li>';
    }
    echo '</ul></div>';
}

And then use maybe

Flexslider2