"use strict"; fetch('https://earth-for-all.com/twentyseventeen/wp-json/wp/v2/posts/49?_embed') .then(data => { if (!data.ok) { throw Error(data.status) } return data.json() }) .then(post => { var txt="" txt = "
Post ID: " + post['id'] + "
" txt += "Author ID: " + post['author'] + "
" txt += "Author Name: " + post._embedded.author[0].name + "
" txt += "Author: " + post._embedded.author[0].name + "
" txt += "Author Description: " + post._embedded.author[0].description + "
" txt += "Date: " + post['date'] + "
" txt += "" + post['date'] + "
" txt += "Slug: " + post['slug'] + "
" txt += "Link: " + post['link'] + "
" txt += "Status: " + post['status'] + "
" var singleThumbnailImage = post['_embedded']['wp:featuredmedia'][0].media_details.sizes.thumbnail.source_url txt += "Thumbnail Image Link: "+ singleThumbnailImage + "
" txt += "Guid: " + post.guid['rendered'] + "
" txt += "Type: " + post['type'] + "
" txt += "" + post.content['rendered'] + "
" txt += "Categories:
" var cats = post['categories'] for(var i = 0; i < cats.length; i++) { txt += "" + cats[i] + "
" } txt += "Tags: " var tags = post['tags'] for(var i = 0; i < tags.length; i++) { txt += "
" + tags[i] + "
" } txt += "