I want to get all the posts in wordpress whose ids are passed in parameter like

My front-page.php have following code

<?php while (have_posts()) : the_post(); ?>
                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()) :
            <?php endwhile;} // end of the loop.   ?>

And I have tried query_posts(‘p=181’); with http://localhost/wordpres/?pid=109 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.

Read more here: Display all posts whose IDs are passed through url


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: