rest-api
-
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:
<h1>{{page_title}}</h1> <article ng-repeat="post in posts"> <h2>{{post.title.rendered}}</h2> <div ng-bind-html="post.content.rendered | to_trusted"></div> <a ui-sref="detail({id: post.id})">Click here to read more</a> </article>
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() { register_api_field(); }
that this error begins to occur:
Error: $resource:badcfg Response does not match configured parameter
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘rest-api’ is closed to new replies.