Title: How to Offset posts
Last modified: July 30, 2019

---

# How to Offset posts

 *  Resolved [SamX](https://wordpress.org/support/users/techlector/)
 * (@techlector)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-offset-posts/)
 * How can I Offset related posts so it can skip few related posts?

Viewing 1 replies (of 1 total)

 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-offset-posts/#post-11785375)
 * Hi techlector
 * There is no offset argument at the moment. If you know the post IDs you want 
   to skip you can use the exlude_posts argument.
 * [https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#exclude-posts](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#exclude-posts)
 * Or use this in your (child) theme’s functions.php file.
 *     ```
       add_filter( 'related_posts_by_taxonomy', 'rpbt_add_offset', 10, 4 );
   
       function rpbt_add_offset( $results, $post_id, $taxonomies, $args ) {
   
       	// Offset of 2 related posts
       	$offset = 2;
   
       	// Remove related posts
       	array_splice( $results, 0, $offset );
   
       	return $results;
       }
       ```
   
 * You’ll need to add the offset (2) to the amount of posts you want to show.
 * btw:
    consider creating a [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/)
   instead of editing your theme directly – if you upgrade the theme all your modifications
   will be lost. Or [create a plugin](https://wordpress.org/plugins/pluginception/)
   with the code above.

Viewing 1 replies (of 1 total)

The topic ‘How to Offset posts’ is closed to new replies.

 * ![](https://ps.w.org/related-posts-by-taxonomy/assets/icon.svg?rev=1115231)
 * [Related Posts by Taxonomy](https://wordpress.org/plugins/related-posts-by-taxonomy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/related-posts-by-taxonomy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)
 * [Active Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/how-to-offset-posts/#post-11785375)
 * Status: resolved