Bummer! That workshop has been retired.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Wordpress, JSON and iOS Blog Reader App

I am preapring to start the "build a blog reader" app, but I need to gahter some info since I already have a potential client intereasted in a "blog reader" iPhone app.

Here comes the question:

Does Wordpress support JSON by default? If not, what is the easiest way to implement it while avoiding diving inot web development etc.

4 Answers

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

Hey Sebastian Nitu,

Wordpress doesn't support it by default I think but there are plenty of plugins that will let you do that. Here's one that gives you a JSON feed for all your posts.

Amit Bijlani, Faye Bridge - I saw that blog.teamtreehouse.com is hosted using WordPress - what plugin does Treehouse use for JSON ?

Thanks in advance for the answer!

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

We use the JSON API plugin and then I created a custom function to get the recent post summary.

Amit Bijlani - For the life of me...I can't figure out why nothing will output at the following address: http://www.newsms.fm/api/get_recent_summary/

I can get an output with : http://www.newsms.fm/api/get_posts/

But that includes HTML tags in the excerpt and doesn't grab the author the same was as from your tutorial. I've installed the JSON API plugin and incorporated the strip of code that you guys had at GitHub...but am at a complete loss right now. Hopefully someone has something?

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

There are might be a runtime error which is not being displayed because by default Wordpress does not display error messages. To change that add the following lines to your wp-config.php:

define('WP_DEBUG_DISPLAY',true);
@ini_set('display_errors',1);

Amit Bijlani I am wondering if i can implement this on my localhost, I have this url: http://localhost:8888/myblog/api/get_recent_summary/ but then I get this 404 error, file not found on this server. Does this only work on a hosted services? Thanks