views:

25

answers:

1

Doing something like this:

    <?php $my_query = new WP_Query('category_name=process&posts_per_page=20');
      while ($my_query->have_posts()) : $my_query->the_post();
      $do_not_duplicate = $post->ID; ?>
      <li><a href="<?php the_permalink(); ?> "><?php the_title(); ?></a></li>
    <?php endwhile; ?>

Destroys the original reference to the single post, which I would want to list afterward. What is the best way to resolve this? I have tried both of the multiple loop examples on the wordpress doc page, and either I misunderstood them, or they don't work. A friend suggested that the only way to do it was to store the original post ID and then to call that post by ID afterward. If that's the solution, then I could use:

<?php $thePostID = $post->ID; ?>

To get the post id, but how do I query a single post by id?

Thanks in advance.

A: 

To query single post by ID you can use get_post( $post_id );, for usage check http://codex.wordpress.org/Function_Reference/get_post

Pragati Sureka