WordPress API single post
-
Hello,
I’m building a small wordpress sitee that should grab the posts from another website that we have. So I created a small plugin that is using the Wp API to grab the latest 5 posts using:
$response = wp_remote_get( 'https://website.com/blog/wp-json/wp/v2/posts?per_page=5' );
Now once I got the 5 posts and I show them on my page, how do I approach creating the single posts? The list of posts are on my new website
/blog
When I click the post link I want it to get me to/blog/post-name
which is fairly easy to do, however, I have no idea how to display the content of the single post inside/blog/post-name
as currently this post doesn’t exist in the DB I get a 404 error
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WordPress API single post’ is closed to new replies.