Link to home
Start Free TrialLog in
Avatar of Daniish
DaniishFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I format the output from WP Rest API?

I have a Wordpress website and i am trying to display content from it on another webpage.
To do this i have installed the WP Rest API plugin (http://v2.wp-api.org/)
I have also installed WP REST API Filter Items plugin (https://github.com/bueltge/wp-rest-api-filter-items)

Using these 2 plugins i am able to retrieve posts from my wordpress website using a GET request, like this:
http://www.heavenlygardens.org.uk/wp-json/wp/v2/posts/1103?items=content

You can see it in action at this url by clicking on the marker:
http://www.heavenlygardens.org.uk/maps/7/7.html

As you can see the following content is returned:
{"content":{"rendered":"<p>This is a demo &#8211; this info should display on the Profile tab!<\/p>\n","protected":false}}

How do i format the output, so that only the content within the <p></p> tags is displayed?
ASKER CERTIFIED SOLUTION
Avatar of James Rodgers
James Rodgers
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial