title: Display all posts whose IDs are passed through url
body: <p>I want to get all the posts in wordpress whose ids are passed in parameter like 
  <a href="http://localhost/wordpres/" rel="nofollow noreferrer">http://localhost/wordpres/</a><strong>?pid=181,109,5,1</strong></p>
  
  <p>My front-page.php have following code </p>
  
  <pre><code>&lt;?php while (have_posts()) : the_post(); ?&gt;
                  &lt;?php
                  if ('posts' == get_option('show_on_front')) {
                      get_template_part('content', 'posts');
                  } else {
                      get_template_part('content', 'page');
                  }
                  // If comments are open or we have at least one comment, load up the comment template
                  if (comments_open() || '0' != get_comments_number()) :
                      comments_template();
                  endif;
                  ?&gt;
              &lt;?php endwhile;} // end of the loop.   ?&gt;
  </code></pre>
  
  <p>And I have tried  <strong>query_posts('p=181');</strong> with <strong><a href="http://localhost/wordpres/?pid=109" rel="nofollow noreferrer">http://localhost/wordpres/?pid=109</a></strong> for single post; it works fine. 
  But I can't sort out how to give query_posts multiple post ids which are passed through url. Need help.</p>