Title: Offset Current Post
Last modified: August 19, 2016

---

# Offset Current Post

 *  [Doobus](https://wordpress.org/support/users/doobus/)
 * (@doobus)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/offset-current-post/)
 * I’ve been trying to find a plugin that displayed related posts via category, 
   and was unable to do so. The next issue was finding a plugin that let me display
   the related posts via thumbnails instead of the title.
 * So I have finally found a solution by using some php trickery, mind you I’m mediocre
   at php at best and so this is my hack and slash job of getting a feature that
   has eluded me.
 * Here is the code:
 *     ```
       <?php if ( in_category('1') ): ?>
                       <?php query_posts('showposts=5&cat=1'); ?>
       	        <?php while (have_posts()) : the_post(); ?>
                       <div class="recent-posts">
                       <div class="ratings-duh"><?php if(function_exists('the_ratings')) { the_ratings(); } ?>
                       </div>
                       <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo get_settings('home'); ?>/wp-content/uploads/<?php $values = get_post_custom_values("thumb_image"); echo $values[0]; ?>" alt="<?php the_title(); ?>" /></a>
                       </div>
                       <?php endwhile; ?>
                       <?php endif; ?>
       ```
   
 * This basically pulls the recent posts from the post’s category and views them
   as a thumbnail. However it also pulls the post that you are currently on if it
   falls under the top 5 latest post in that category. Is there a way to offset 
   the query to not pull the post it’s on? Hope this makes sense. Thanks in advance.

The topic ‘Offset Current Post’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Doobus](https://wordpress.org/support/users/doobus/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/offset-current-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
