{"id":13294085,"date":"2020-08-21T15:35:25","date_gmt":"2020-08-21T15:35:25","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wordpress-api-single-post\/"},"modified":"2020-08-21T15:35:25","modified_gmt":"2020-08-21T15:35:25","slug":"wordpress-api-single-post","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wordpress-api-single-post\/","title":{"rendered":"WordPress API single post"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I&#8217;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:<br \/>\n<code>$response = wp_remote_get( &#039;https:\/\/website.com\/blog\/wp-json\/wp\/v2\/posts?per_page=5&#039; );<\/code><\/p>\n<p>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 <code>\/blog<\/code> When I click the post link I want it to get me to <code>\/blog\/post-name<\/code> which is fairly easy to do, however, I have no idea how to display the content of the single post inside <code>\/blog\/post-name<\/code> as currently this post doesn&#8217;t exist in the DB I get a 404 error<\/p>\n","protected":false},"template":"","class_list":["post-13294085","topic","type-topic","status-publish","hentry","topic-tag-api","topic-tag-posts","topic-tag-rest"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13294085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13294085\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13294085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}