Hi, I am using and enfold child theme with the plugin search and filter and am trying to insert and extra php file into the search template.
I am using jQuery to find out what the user has searched for and then depending on the search, I want to show some shortcode.
So, in my jQuery I have:
jQuery(document).ready(function () {
if(window.location.href === "http://www.mysite.co.uk/?sfid=132396&_sfm_department=1"){
jQuery("#dannbox").load('http://www.mysite.co.uk/wp-content/themes/child-theme/this.php');
}
this successfully returns any content from test.php into the div ‘dannbox’ on the search template, all apart from any shortcode that is… I am hoping to load some of enfolds shortcodes into this box depending on the search… Namely blog posts… But I get an error:
Fatal error: Call to undefined function do_shortcode() in /home/xxxxx/public_html/wp-content/themes/child-theme/this.php on line 2
… Is there something I have to include in my functions.php or on this.php for shortcodes to work.
thanks!
Hey dannhanks,
Please refer to this post also please see – https://codex.wordpress.org/Shortcode_API
Best regards,
Yigit
yeah thanks I went on that page before, support at the search and filter plugin were very helpful and helped me sort it.