Forums Forums Search & Filter Pro Multiple results templates ajax

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #56798

    Hi there,

    I need to have multiples results templates so I have modified “results.php” to :
    global $post;
    if($post->post_parent == 252 && !is_page(723)){
    include(‘results-directories.php’);
    }else if(is_page(array(723))) {
    include(‘results-directory-jobs.php’);
    }else if(is_page(array(613,617,623,627))){
    include(‘results-news-blog.php’);
    }else if($post->post_parent == 577){
    include(‘results-events.php’);
    }

    It works all fine when I don’t use Ajax although when I enable Ajax the script does not work anymore.

    I have came to a conclusion that without reloading the page the if statement in “results.php” is not executed and so no result is shown.

    Is there a way to use different results templates and at the same time use Ajax?

    Thanks in advance.

    Marco

    Trevor
    #56842

    Hi

    are you using a copy of results.php in your child theme? You also name the file, for example, if your S&F form has an ID of 545, the result.php file can be named 545.php. See here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    Anonymous
    #57117

    Thanks. Will give this a go.

    Trevor
    #57120

    Let me know how you get on. I will wait to hear from you, and if I can close this thread?

    Anonymous
    #57590

    Hi Trevor,

    Sorry for getting back to you only now.

    I have managed to work on it only today and It works fine.

    Thanks again.

    Marco

Viewing 5 posts - 1 through 5 (of 5 total)