Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #772568

    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!

    • This topic was modified 6 years, 11 months ago by dannhanks.
    #775427

    Hey dannhanks,

    Please refer to this post also please see – https://codex.wordpress.org/Shortcode_API

    Best regards,
    Yigit

    #775435

    yeah thanks I went on that page before, support at the search and filter plugin were very helpful and helped me sort it.

    #775439

    Hi!

    Great! Glad you figured it out!
    Let us know if you have any other questions or issues :)

    Regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Including extra php templates for using shortcodes.’ is closed to new replies.