{"id":2534,"date":"2021-04-18T12:47:30","date_gmt":"2021-04-18T10:47:30","guid":{"rendered":"https:\/\/codeart.studio\/?p=2534"},"modified":"2021-04-18T15:02:18","modified_gmt":"2021-04-18T13:02:18","slug":"fetch-and-display-remote-posts-via-wordpress-rest-api","status":"publish","type":"post","link":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/","title":{"rendered":"Fetch and display remote posts via WordPress REST API"},"content":{"rendered":"\n<p>In this article we&#8217;ll take a look at how we can fetch some posts from a remote WordPress blog and display them on another WordPress site. For example, you might have two different WordPress websites and write about different topics. But, some topics may be of interest to the readers of both of your blogs. In this case, you might want to offer your readers some posts from the original blog. <\/p>\n\n\n\n<p>Now, I don&#8217;t encourage you to duplicate posts from the original to another blog (SEO reasons), but you might want to offer a feed of articles from the original blog, and link them back to the original blog from the second one. And this is exactly what I&#8217;ll show you how to do. We&#8217;ll create a page template with the feed of articles that will display things like image, title and description, and a link to the original post.<\/p>\n\n\n\n<p>What you&#8217;ll need:<\/p>\n\n\n\n<div class=\"wp-block-group numberedList\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ol class=\"wp-block-list\"><li>Working REST endpoint for &#8216;posts&#8217; on the original website<\/li><li>A blank page template on the second blog where we&#8217;ll embed the posts feed<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<p>So, let&#8217;s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Page template for displaying the feed<\/h2>\n\n\n\n<p>First, we&#8217;ll create a blank page template and give it a name. Create a file inside the root of your WordPress theme. We&#8217;ll call it &#8216;<strong>template-page-feed.php<\/strong>&#8216;. Inside the file, you&#8217;ll put this code at the very top:<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c0dbe99ad0\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n    \/**\r\n * Template Name:Posts Feed\r\n *\/<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>This is the standard way to initialize a blank page template in WordPress and make it available in the template selector inside the page edit screen in WordPress dashboard. So, go ahead and create a new page and set the active template to our new <strong>Posts Feed<\/strong> template. If you need some more information on the topic of WordPress page templates, there&#8217;s a wealth of information in the <a href=\"https:\/\/developer.wordpress.org\/themes\/template-files-section\/page-template-files\/\" target=\"_blank\" rel=\"noreferrer noopener\">official Page Templates article<\/a> on wordpress.org.<\/p>\n\n\n\n<p>Anyway, after we&#8217;ve created our blank page template, it&#8217;s time to write some code. Yay!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Some consideration before accessing any REST API<\/h2>\n\n\n\n<p>Now, when fetching remote data from a REST API, there&#8217;s some performance consideration to take into account. Since we&#8217;re displaying our feed when a visitor loads the page, what we don&#8217;t want to do, is to make a remote API request on each page load. This would unnecessarily put extra load and could lead to some undesirable behavior on the remote server. Also, in general, many API&#8217;s have a rate-limit where you can only make a certain amount of requests before you get locked out (<a href=\"https:\/\/aws.amazon.com\/cloudfront\/pricing\/\" target=\"_blank\" rel=\"noreferrer noopener\">or even billed heftily<\/a>), so it&#8217;s never a good idea to put yourself into a situation where you&#8217;re making an unpredictable amount of external API requests.<\/p>\n\n\n\n<p>This is why we&#8217;re going to cache our API response.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress transients<\/h2>\n\n\n\n<p>A handy way to cache things in WordPress is to use <a href=\"https:\/\/developer.wordpress.org\/apis\/handbook\/transients\/\" target=\"_blank\" rel=\"noreferrer noopener\">transients<\/a>. Transients are temporary data stored in a WordPress database that have an expiration date. Now, transients can be deleted automatically even before the expiration date (perhaps through a database maintenance or a similar action), but transient data will never exist after an expiration date. But that should not matter &#8211; transients are absolutely not a way to store any critical data, but only the data that can easily and automatically be created over and over again. And this is a perfect solution for our REST API data because it will save us many API calls to our remote site.<\/p>\n\n\n\n<p>So, the first thing we&#8217;ll do, before writing our API call, is to check whether we already have a data in our transient. It looks a little bit like this:<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c1f9099ad2\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n    \/**\r\n * Template Name:Posts Feed\r\n *\/\r\n\r\ndefine( 'HOURS', 60 * 60 * 12 );\r\nfunction get_remote_api_data( ) {\r\n global $apiData; \r\n    if( empty($apiData) ) $apiInfo = get_transient('api_data'); \r\n    if( !empty($apiData) ) return $apiData;\r\n}<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>So, let&#8217;s go through this code line by line:<\/p>\n\n\n\n<div class=\"wp-block-group numberedList\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ol class=\"wp-block-list\"><li>Line 5 &#8211; we&#8217;re defining our &#8216;HOURS&#8217; constant that we&#8217;ll use for the expiration time for our transient. In this case, I&#8217;ve set it to 12 hours (in seconds). We&#8217;ll need this later on in our code.<\/li><li>Line 7 &#8211; the name of our function. I find it easier to define a function and then call it later on when and where I need it. <\/li><li>Line 8 &#8211; 9 &#8211; we&#8217;re checking whether we have any data in our variable. If we don&#8217;t&#8217;, we&#8217;ll fetch our transient entry named &#8216;api_data&#8217; (line 8). If we do, we&#8217;ll simply output it(line 9).<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<p>So, the first part revolves around checking if we already have any API data at all, or if we have any API data in our transient. But, what if we don&#8217;t? We then make the magic that is called remote API request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Remote API request<\/h2>\n\n\n\n<p>By now we&#8217;ve determined we have no previous data in our variable or our transient, and we&#8217;re ready to make the call. This is how it&#8217;s done:<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c22c299ad3\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n      $response = wp_remote_get('https:\/\/codeart.studio\/wp-json\/wp\/v2\/posts?per_page=5&_embed',  array(\r\n      'timeout'     => 20,\r\n  ));\r\n    $data = wp_remote_retrieve_body($response);\r\n    \r\nif( empty($data) ) return false;\r\n\r\n    $apiData= json_decode($data);\r\n   \r\n    set_transient( 'api_data', $apiData, HOURS ); \r\n\r\n    return $apiInfo;<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>Let&#8217;s take a look what&#8217;s going on in the above code:<\/p>\n\n\n\n<div class=\"wp-block-group numberedList\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ol class=\"wp-block-list\"><li>Line 1 &#8211; 3 &#8211; this is where the magic happens, and it&#8217;s quite simple. We&#8217;re making a call to our &#8216;posts&#8217; endpoint by using <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_remote_get\/\" target=\"_blank\" rel=\"noreferrer noopener\">wp_remote_get<\/a> function, and we&#8217;re setting the timeout for the call to 20 seconds. I&#8217;ve found that this is (for me at least) a sweet spot for how much I&#8217;m willing to wait for the call to complete. Anything more than that and something&#8217;s wrong, and anything less than that and you might not finish what you started in the first place. We&#8217;re appending two parameters to the call &#8211; the &#8216;posts_per_page&#8217; (a standard wp_query argument for retrieving an X amount of posts), and <a href=\"https:\/\/developer.wordpress.org\/rest-api\/using-the-rest-api\/linking-and-embedding\/\" target=\"_blank\" rel=\"noreferrer noopener\">&#8216;_embed&#8217;<\/a>, which gives us all the necessary data attached to a single post without the need to request more data (most notably the URLs to the featured images).<\/li><li>Line 4 &#8211; by using <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_remote_retrieve_body\/\" target=\"_blank\" rel=\"noreferrer noopener\">wp_remote_retrieve_body<\/a> we&#8217;re parsing our data so that we&#8217;re only left with the body of the response, because that&#8217;s really all we need.<\/li><li>Line 6 &#8211; if there&#8217;s no response, we stop the execution of our function.<\/li><li>Line 8 &#8211; since the data we&#8217;ve received is in the <a href=\"https:\/\/www.json.org\/json-en.html\" target=\"_blank\" rel=\"noreferrer noopener\">JSON format<\/a>, we need to convert it into a PHP array so that we can use it to render our post later on, therefore we use <a href=\"https:\/\/www.php.net\/manual\/en\/function.json-decode.php\" target=\"_blank\" rel=\"noreferrer noopener\">json_decode<\/a>.<\/li><li>Line 10 &#8211; this is where <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/set_transient\/\" target=\"_blank\" rel=\"noreferrer noopener\">transients<\/a> and caching come into play. Like I wrote earlier, in order to reduce the number of remote API request, we&#8217;re storing our response inside a transient entry called &#8216;api_data&#8217;, and setting it to expire in 12 hours (or any number of days \/ hours \/ minutes \/ seconds you might want). For the expiration time we use the constant we&#8217;ve defined earlier, &#8216;HOURS&#8217;.<\/li><li>Line 12 &#8211; last but not least, we return the result of our function.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<p>So, let&#8217;s put together the entire function once more inside a single code block:<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c266199ad4\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n    define( 'HOURS', 60 * 60 * 12 );\r\nfunction get_remote_api_data( ) {\r\n global $apiData; \r\n    if( empty($apiData) ) $apiInfo = get_transient('api_data'); \r\n    if( !empty($apiData) ) return $apiData;\r\n\r\n  $response = wp_remote_get('https:\/\/codeart.studio\/wp-json\/wp\/v2\/posts?per_page=5&_embed',  array(\r\n      'timeout'     => 20,\r\n  ));\r\n    $data = wp_remote_retrieve_body($response);\r\n    \r\nif( empty($data) ) return false;\r\n\r\n    $apiData= json_decode($data);\r\n   \r\n    set_transient( 'api_data', $apiData, HOURS ); \r\n\r\n    return $apiInfo;\r\n\r\n}<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>So, now that we have a ready function for making the remote API call, we need to use it, and render our posts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rendering the posts from the remote API data<\/h2>\n\n\n\n<p>Let&#8217;s get our data by using our function and store the data into variables before we render it:<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c29b999ad5\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n    $feed = get_remote_api_data();\r\nif($feed) : \r\nforeach($feed as $post) {\r\n    $title= $post->title->rendered;\r\n    $image= $post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes->{'medium'}->source_url;\r\n    $excerpt= $post->excerpt->rendered;\r\n    $link = $post->link;<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>Let&#8217;s see what we&#8217;re doing in the above code block:<\/p>\n\n\n\n<div class=\"wp-block-group numberedList\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ol class=\"wp-block-list\"><li>Line 1 &#8211; we&#8217;re getting the data from our function<\/li><li>Line 3 &#8211; We loop through our data to get the information for each post<\/li><li>Line 4 &#8211; 7 &#8211; we&#8217;re getting the post data, the title, featured image, excerpt and link (back to our original website of course) and storing it into variables.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<p>A note on the Line 5 &#8211; by using the _embedded key, we&#8217;re fetching the linked resource, in this case the media for the post, and getting the information we need to create a link to the media (the size and the URL of that image size).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rendering the posts<\/h2>\n\n\n\n<p>Now that we have all the data we need, we&#8217;re rendering the post (remember, we&#8217;re still inside the foreach loop):<\/p>\n\n\n<div id=\"code-highlight-blokblock_607c2b83beac3\" class=\"code-highlight-blok blokovi \">\n<div class=\"innerWrap\">\n    <pre class=\"line-numbers\" data-prismjs-copy=\"Copy\"><code class=\"language-php\">\n    foreach($feed as $post) {\r\n    $title= $post->title->rendered;\r\n    $image= $post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes->{'medium'}->source_url;\r\n    $excerpt= $post->excerpt->rendered;\r\n    $link = $post->link;\r\n\r\n    $html = '&lt;div class=\"featuredImage\"&gt;&lt;a href=\"'.$link.'\"&gt;&lt;img src=\"'.$image.'\" \/&gt;&lt;\/a&gt;&lt;\/div&gt;'; \/\/the image and the link\r\n    $html .= '&lt;div class=\"title\"&gt;&lt;h3&gt;&lt;a href=\"'.$link.'\"&gt;'.$title.'&lt;\/a&gt;&lt;\/div&gt;&lt;\/h3&gt;'; \/\/the title and the link\r\n    $html .= '&lt;div class=\"excerpt\"&gt;'.$excerpt.'&lt;\/div&gt;'; \/\/the excerpt\r\n\r\n    echo $html;\r\n} \/\/end foreach loop<\/code><\/pre>\n<\/div><!--\/.innerWrap-->\n<\/div><!--\/.usluge-blok-->\n\n\n\n<p>And, that&#8217;s pretty much it. Now you have a loop of posts displayed from a remote website via WordPress REST API. Isn&#8217;t that cool?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we&#8217;ll take a look at how we can fetch some posts from a remote WordPress blog and display them on another WordPress site. For example, you might &hellip; <a href=\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\">More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2534","post","type-post","status-publish","format-standard","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fetch and display remote posts via WordPress REST API - CodeArt Studio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fetch and display remote posts via WordPress REST API - CodeArt Studio\" \/>\n<meta property=\"og:description\" content=\"In this article we&#8217;ll take a look at how we can fetch some posts from a remote WordPress blog and display them on another WordPress site. For example, you might &hellip; More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeArt Studio\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-18T10:47:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-18T13:02:18+00:00\" \/>\n<meta name=\"author\" content=\"CodeArt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodeArt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\",\"url\":\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\",\"name\":\"Fetch and display remote posts via WordPress REST API - CodeArt Studio\",\"isPartOf\":{\"@id\":\"https:\/\/codeart.studio\/#website\"},\"datePublished\":\"2021-04-18T10:47:30+00:00\",\"dateModified\":\"2021-04-18T13:02:18+00:00\",\"author\":{\"@id\":\"https:\/\/codeart.studio\/#\/schema\/person\/1b0cd5eeb1ee7bb87ff6d62387575879\"},\"breadcrumb\":{\"@id\":\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codeart.studio\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fetch and display remote posts via WordPress REST API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codeart.studio\/#website\",\"url\":\"https:\/\/codeart.studio\/\",\"name\":\"CodeArt Studio\",\"description\":\"Samo jo\u0161 jedna WordPress web-stranica\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codeart.studio\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/codeart.studio\/#\/schema\/person\/1b0cd5eeb1ee7bb87ff6d62387575879\",\"name\":\"CodeArt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codeart.studio\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a9fe9f46fcf3e84a874ad29f30465e42?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a9fe9f46fcf3e84a874ad29f30465e42?s=96&d=mm&r=g\",\"caption\":\"CodeArt\"},\"description\":\"Zelimir is a WordPress developer (11+ years) based in Croatia. He loves working with REST APIs, and building ecommerce stores based on Roots\/Sage &amp; WooCommerce. When he's not parsing JSON into XML, he's either working out in his home gym or spending time with his kids.\",\"sameAs\":[\"http:\/\/codeart.studio\/cms\"],\"url\":\"https:\/\/codeart.studio\/author\/zelimir83\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fetch and display remote posts via WordPress REST API - CodeArt Studio","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/","og_locale":"en_US","og_type":"article","og_title":"Fetch and display remote posts via WordPress REST API - CodeArt Studio","og_description":"In this article we&#8217;ll take a look at how we can fetch some posts from a remote WordPress blog and display them on another WordPress site. For example, you might &hellip; More","og_url":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/","og_site_name":"CodeArt Studio","article_published_time":"2021-04-18T10:47:30+00:00","article_modified_time":"2021-04-18T13:02:18+00:00","author":"CodeArt","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CodeArt","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/","url":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/","name":"Fetch and display remote posts via WordPress REST API - CodeArt Studio","isPartOf":{"@id":"https:\/\/codeart.studio\/#website"},"datePublished":"2021-04-18T10:47:30+00:00","dateModified":"2021-04-18T13:02:18+00:00","author":{"@id":"https:\/\/codeart.studio\/#\/schema\/person\/1b0cd5eeb1ee7bb87ff6d62387575879"},"breadcrumb":{"@id":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codeart.studio\/fetch-and-display-remote-posts-via-wordpress-rest-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codeart.studio\/"},{"@type":"ListItem","position":2,"name":"Fetch and display remote posts via WordPress REST API"}]},{"@type":"WebSite","@id":"https:\/\/codeart.studio\/#website","url":"https:\/\/codeart.studio\/","name":"CodeArt Studio","description":"Samo jo\u0161 jedna WordPress web-stranica","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codeart.studio\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/codeart.studio\/#\/schema\/person\/1b0cd5eeb1ee7bb87ff6d62387575879","name":"CodeArt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codeart.studio\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a9fe9f46fcf3e84a874ad29f30465e42?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a9fe9f46fcf3e84a874ad29f30465e42?s=96&d=mm&r=g","caption":"CodeArt"},"description":"Zelimir is a WordPress developer (11+ years) based in Croatia. He loves working with REST APIs, and building ecommerce stores based on Roots\/Sage &amp; WooCommerce. When he's not parsing JSON into XML, he's either working out in his home gym or spending time with his kids.","sameAs":["http:\/\/codeart.studio\/cms"],"url":"https:\/\/codeart.studio\/author\/zelimir83\/"}]}},"_links":{"self":[{"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/posts\/2534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/comments?post=2534"}],"version-history":[{"count":0,"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/posts\/2534\/revisions"}],"wp:attachment":[{"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/media?parent=2534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/categories?post=2534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeart.studio\/wp-json\/wp\/v2\/tags?post=2534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}