jQuery: var URL = "http://siteadiniz.com/wp-json/wp/v2/posts";
$.getJSON(URL, function(data) {
$.each(data, function(key, val) {
$('.list').append('<li><a href="'+val.link+'">' + val.title.rendered + '</a></li>');
})
});HTML <ul class="list"></ul>
Düzeltme:
Son 5 yazıyı göstermek için jQuery'e bu şekilde ekleme yapabilirsiniz.
var URL = "http://siteadiniz.com/wp-json/wp/v2/posts";
$.getJSON(URL, function(data) {
$.each(data.slice(0,5), function(key, val) {
$('.list').append('<li><a href="'+val.link+'">' + val.title.rendered + '</a></li>');
})
});Demo: https://prnt.sc/16czfyj