{"id":534,"date":"2010-10-08T21:32:12","date_gmt":"2010-10-08T19:32:12","guid":{"rendered":"http:\/\/www.kavdesign.net\/blog\/?p=534"},"modified":"2011-11-08T12:08:51","modified_gmt":"2011-11-08T10:08:51","slug":"function-to-get-wordpress-theme-url","status":"publish","type":"post","link":"https:\/\/www.kavdesign.net\/blog\/coding\/function-to-get-wordpress-theme-url\/","title":{"rendered":"Function to get wordpress theme URL"},"content":{"rendered":"<p>This function will <em>return<\/em> the theme directory URL so you can use it in other functions:<\/p>\n<pre><code>get_bloginfo('template_directory');\r\n<\/code><\/pre>\n<p>Alternatively, this function will <em>echo<\/em> the theme directory URL to the browser:<\/p>\n<pre><code>bloginfo('template_directory');\r\n<\/code><\/pre>\n<p>So an example for an image in the themes <code>images\/headers<\/code> folder would be:<\/p>\n<pre><code>&lt;img src=\"&lt;?php bloginfo('template_directory'); ?&gt;\/images\/headers\/image.jpg\" \/&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This function will return the theme directory URL so you can use it in other functions: get_bloginfo(&#8216;template_directory&#8217;); Alternatively, this function will echo the theme directory&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.kavdesign.net\/blog\/coding\/function-to-get-wordpress-theme-url\/\">Continue reading<span class=\"screen-reader-text\">Function to get wordpress theme URL<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9,82],"tags":[112,223,222,111,130,418],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-coding","category-wordpress","tag-function","tag-get","tag-path","tag-theme","tag-url","tag-wordpress","entry"],"_links":{"self":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":2,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":735,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/534\/revisions\/735"}],"wp:attachment":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}