{"id":12838519,"date":"2020-05-15T09:16:40","date_gmt":"2020-05-15T09:16:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/using-do_shortcode-2\/"},"modified":"2020-05-15T09:16:40","modified_gmt":"2020-05-15T09:16:40","slug":"using-do_shortcode-2","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/using-do_shortcode-2\/","title":{"rendered":"Using do_shortcode()"},"content":{"rendered":"<p>Hello,<br \/>\nApologies if this is in the wrong forum section. <\/p>\n<p>I am trying to automatically refresh a function for a number calculation, I&#8217;ve added a shortcode to this function for ease of adding to a page. I want this function to update after X amount of seconds rather than reloading entire page.<\/p>\n<p>The current way I&#8217;m trying this is using .load(&#8216;\/file.php&#8217;) wrapped in a set interval function. This then loads a php file containing echo do_shortcode(&#8216;[shortcodename]&#8217;);<br \/>\nThe refresh function works great when loading in the .php file containing basic text as a test, however adding the do_shortcode function flags using fatal error: undefined function do_shortcode. <\/p>\n<p>What am I missing to make sure do_shortcode function is recognised ? <\/p>\n<p>Thanks in advance! Still a novice when it comes to wordpress<\/p>\n","protected":false},"template":"","class_list":["post-12838519","topic","type-topic","status-publish","hentry","topic-tag-do_shortcode","topic-tag-jquery"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12838519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12838519\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12838519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}