I am trying to develop a small WordPress plugin to fetch the posts, pages from the website and parse it as json to further use in mobile apps. Right now I am achieving the goal via this method:
1) Created a file webservice.php
on my current active theme eg. twentythirteen. So the location of the file is:
http://www.example.com/wp-content/themes/twentythirteen/webservice.php
2) I am posting the parameters on that URL to get a JSON response like this
http://www.example.com/wp-content/themes/twentythirteen/webservice.php?type=page&limit=10
The thing is I want to post parameters on the home page like this:
http://www.example.com?type=page&limit=10
I don't know how to do it but I have seen the JSON API plugin which is doing the same thing but I'm not able to find in the code how it's fetching the request from the home page and parse JSON on the same page. How can I do this?