Support » Plugin: WP REST API (WP API) » WP API data doesn't display

  • I am trying to use the below line of code to access my wordpress site’s api posts, but it just spins and doesnt display anything.

    ‘$http.get(‘http://marklovettphotography.com/wp-json/posts’

    Will anybody please offer some advice?

    I successfully installed the WP REST API plugin, and the json data can be accessed here: marklovettphotography.com/wp-json/posts

    I replaced the above line of code with the url in the request below and it should work.

    This below app.js code works in my angularjs app, so I know it’s set up correctly. It displays 10 posts from a public-wordpress API.

    ‘.service(‘myService’, function($http) {
    this.getBlogs = function($scope) {
    $http.jsonp(‘https://public-api.wordpress.com/rest/v1/freshly-pressed?callback=JSON_CALLBACK’)
    .success(function(data) {
    $scope.posts = data.posts;
    $scope.$broadcast(‘scroll.refreshComplete’);
    });
    };
    })’

    https://wordpress.org/plugins/json-rest-api/

  • The topic ‘WP API data doesn't display’ is closed to new replies.