WordPress JSON API Plug-in: How can I put the output of a JSON query into a PHP string?

I installed the JSON API Plug-In for my wordpress site. I want to display on an external site how many posts I have in a certain category.

For example, I have a URL like this: http://mywordpress.com/?json=get_category_posts&slug=press%20releases

Read More

Along the output, I almost immediately see a field “post_count” and a number right after it. I want to encapsulate this number into a string so I can output that number onto a table. But in order for me to be able to do that I need to have the entire output in a variable.

But I can’t have something like

$json-output = http://mywordpress.com/?json=get_category_posts&slug=press%20releases;
echo $json-output;

That’s just gonna output the URL, not the result of the JSON query.

I hope the question is making sense. Any guidance would be appreciated.

Related posts

Leave a Reply

1 comment