WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Creating Posts from JSON feed to a Custom Post Type (2 posts)

  1. jonohale
    Member
    Posted 1 year ago #

    Hey there,

    I'm trying to setup a wordpress site that gets posts from a JSON feed for a custom post type. Also with it adding parts of the JSON feed to custom fields.

    How would we go about this? We have a few feeds needing to added as well.

    Have searched far and wide online and found no solid answers.

    Cheers,

    Jono

    http://wordpress.org/extend/plugins/json-api/

  2. Brian
    Member
    Posted 1 year ago #

    I am attempting to do the same exact thing.

    We ended up using the WP API plugin, and modifying the output of the feed to include custom fields. The problem with this approach is that the feeds aren't cached and we have no way of differentiating between post types. So the out json feed is messy, but it works. We are using the feed for an iOS app.

    The Plugin: http://wordpress.org/extend/plugins/wp-api/

    We modified the output of the feed like this:
    "'Name' => get_post_meta($value->ID, 'CUSTOM-FIELD'),
    In this example URL: http://www.domain.com/?wpapi=get_posts&dev=1&type=posts the above code would go around line 270 of "get_posts.php'.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic