Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • This gets rid of the post from the undesired category, however I now only have 3 posts showing, instead of 4. Commented Apr 26, 2015 at 20:26
  • I have edited my answer. Commented Apr 26, 2015 at 22:11
  • Have you verified there are actually 4 posts to show? With the offset field, you'll need there to be 5 posts for 4 to show Commented Apr 26, 2015 at 22:11
  • I have 7 posts in the desired category (9 posts total), more than enough. I should be able to offset by 1 and still get 4 posts from my query, not 3. Update: I have edited my query to remove the offset (I initially thought it was necessary since I was using if( $post->ID == $do_not_duplicate ) continue; to keep the current post from showing up in my query, but now it doesn't seem to be necessary). I now have simply 'post_type' = 'post', 'category_name' = 'episodes', 'orderby' = 'rand', and 'posts_per_page' = 4, and now sometimes I get 4 posts, but a lot of times I only get 3 posts. Commented Apr 26, 2015 at 23:19