Previous / Next Post
In this episode we are going to use Vue.js and WP REST API to show previous and next post in our preview box.
To show previous or next posts we can use getThePost
method that we created in the previous episode. Only thing we need to do is somehow get the ID’s of previous and next post relative to the current post.
To get those ID’s we will manipulate WordPress REST API using get_adjacent_post
function. And then we are going to pass those ID’s to our getThePost
method.