Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix rest-api

Discussion in 'Misc WordPress Requests' started by ldco2016, Oct 29, 2017.

  1. ldco2016


    rest-api, by ldco2016

    I am developing a WordPress theme with Angular.

    I have connected Angularjs with WordPress using ng-repeat to display a list of WordPress posts in templates/list.html:


    <article ng-repeat="post in posts">
    <div ng-bind-html="post.content.rendered | to_trusted"></div>
    <a ui-sref="detail({id: post.id})">Click here to read more</a>

    I created a single post template and route and connecting the two views both single and post. Now I want to add custom data to the API response and displaying it. To do that I add:

    function register_new_field() {}

    inside of functions.php. It’s when I start this:

    function register_new_field() {

    that this error begins to occur:

    Error: $resource:badcfg
    Response does not match configured parameter


Share This Page

Monarch Social Sharing Plugin