I am not familiar with PHP Syntax. Now i added JSON Plugin to my wordpress website and activate it.
When i open url to get_recent_post
, it's fine. JSON data are showing.
But when i open get_post
, it's only showing
{"status":"error","error":"Include 'id' or 'slug' var in your request."}
So i don't know how to add post id to that URL.
here is the pic. Another get_page , gate_date_posts
, etc... links are same showing error.
How can i do it?
http://yoursite.com/api/get_posts/
with the s
If you use the WordPress link and click on it, you will be fine.
To display a post's ID, simply use the following PHP code within the WordPress loop:
To return the ID, use the following PHP code within the WordPress loop:
To get a post's id outside of the WordPress loop use the following PHP code:
Hope that helps you.