• bigswp

    (@bigswordpress)


    I am trying to learn the API and have gotten all the way to the end but now what? Meaning I have been using the API to ‘Get Recent Posts’ from one Multisite to display on another Multisite. I see all the json code I have managed to figure out how to filter it by post amount, category, etc. but I will say it again NOW WHAT? How do I actually display any of this information on the web page? I am 3 days into this now and can’t find a single Beginning to end tutorial. Any help would be appreciated.

    https://ww.wp.xz.cn/plugins/json-rest-api/

Viewing 1 replies (of 1 total)
  • Once you get the JSON data you can just parse it to use on your application. I don’t know if you are using php or js for data representation.

    Below is documentation for to handle json with php

    http://php.net/manual/en/book.json.php

    Very basic example

    <?php
        $json = {}; // data you got from the json api
        $posts = json_decode($json);
    
        foreach ($posts as $post){
            var_dump($post);
        }
    ?>

    Hope it helps!

Viewing 1 replies (of 1 total)

The topic ‘Get Recent Posts’ is closed to new replies.