Advanced Custom Fields
-
Hi,
I can see my Advanced custom field in my get posts request, but I can see how I am supposed to call it within the Javascript of my mobile app.
I currently have –
function listPosts(data) {
var output = ‘<form class=”ui-filterable”><input id=”searchposts” data-type=”search”></form>’;output += ‘<ul data-role=”listview” data-filter=”true” data-input=”#searchposts”>’;
$.each(data.posts, function(key, val) {var tempDiv = document.createElement(“tempDiv”);
tempDiv.innerHTML = val.excerpt;
$(“a”, tempDiv).remove();
var excerpt = tempDiv.innerHTML;output += ‘
- ‘;
output += ‘‘;
output += (val.thumbnail) ?
‘<img src=”‘ + val.thumbnail + ‘” alt=”‘ + val.title + ‘”>’:
‘<img src=”images/copy-logo.png” alt=”iDrum”>’;
output += ‘<h3>’ + val.title + “</h3>”;
output += ‘<p>’ + excerpt + “</p>”;
output += ‘‘;
output += ‘
‘;
}); //go through each post
output += “”;
$(‘#postlist’).html(output);
} //listPostsWhat I want to do is to replace the link to the post to link to the web address in the ACF…
Can anyone point me in the right direction? I can’t seem to find any examples/tutorials online.
Thanks!
- ‘;
The topic ‘Advanced Custom Fields’ is closed to new replies.