How to count posts in a range using get_recent_posts
-
If I am viewing a single custom post type page. I’d like to know how many posts away from a selected post. Each post is an event.
If I’m focusing on an event that is coming next, I can locate it fine by using the “meta_value” and “meta_compare” arguments.
The way I’d like to expand upon my post type is by including some information at the top, ie. “You are viewing +5 posts in the future” or “You are reading 8 posts in the past, jump to the next (event)”
Thank you in advance.
- The topic ‘How to count posts in a range using get_recent_posts’ is closed to new replies.