Filter next_post_link() and previous_post_link() by meta_key?

I managed to get this working using nothing but WordPress filters, thanks to @Milo’s hint. Just note that these are pretty specific to my case but you shouldn’t have a problem modifying them for your own use. I am using Advanced Custom Fields with a Date Picker field called date and Prev/Next links only point … Read more

Get Previous & Next posts by Post ID

Take a look at get_previous_post() and get_next_post() and you’ll see they both use the get_adjacent_post() to find the previous or next post. Let’s say you want to fetch the ID of the immediately previous post based on the current post’s ID. This is what you’d do: function get_previous_post_id( $post_id ) { // Get a global … Read more