I'm using blogger, and I need to "generate" the categories for each post.
function posts(json) {
for (var i = 0; i < 11; i++) {
var post = json.feed.entry[i];
var postLabels = [];
}
for (var b = 0; b < post.category.length; b++) {
postLabels.push(post.category[b].term);
}
document.write('<span>'+postLabels.join(', ')+'</span>');
}
}
It works, but shows only the first category of each post. I need you to display all of them, how do I?
"published": {
"$t": "2014-09-06T22:43:00.001-07:00"
}
,
"updated": {
"$t": "2018-04-15T13:24:56.217-07:00"
}
,
"category":[ {
"scheme": "http://www.blogger.com/atom/ns#", "term": "Car"
}
,
{
"scheme": "http://www.blogger.com/atom/ns#", "term": "Gallery"
}
,
{
"scheme": "http://www.blogger.com/atom/ns#", "term": "People"
}
,
{
"scheme": "http://www.blogger.com/atom/ns#", "term": "Technology"
}
,
{
"scheme": "http://www.blogger.com/atom/ns#", "term": "Teste"
}
],
"title": {
"type": "text", "$t": "Photodune Vintage Car"
}