Forums Forums Search & Filter Pro Unable to enable search on an Archive page

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #246673

    Hi there,

    i’ve purchases Search & Filter Pro and am looking to have independent search forms on each of the 2 CPT archive pages I have. I’ve added the search form to the respective archive-{slug}.php templates but can’t for the life of me figure out how to make the results show up??

    I’ve selected “As a Post Archive” from the “Display Results” tab, and still nothing…

    Anonymous
    #246674

    I’ll also add that I’m using ACF, and am looking to search & filter based on ACF parameters.

    Trevor
    #246748

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #246865
    This reply has been marked as private.
    Anonymous
    #246893

    Hi Trevor,

    I managed to get something loading via displaying results “As an Archive”, however, it doesn’t look like the search is actually searching anything?

    It looks to just be reversing the order of the results already on the page but not actually filtering.

    Any ideas?

    Trevor
    #247143

    I can see the problem. Your footer is not calling the wp_footer function, and so our javascript is not loading. Or, if the theme footer file IS calling wp_footer, something is stopping it from calling the file.

    So, if you cannot fix it in the theme footer file, this means you must load (enqueue) the file manually, from the child theme functions.php file.

    The URL looks like this:

    …/wp-content/plugins/search-filter-pro/public/assets/js/search-filter-build.min.js

    You would need to add this as an enqueued file.

    Something like this in the child theme (it must be a child theme unless the theme is totally bespoke to you (and thus not going to be updated by a theme author)) functions.php file:

    function search_filter_pro_enqueue_script() {   
        wp_enqueue_script( 'search-filter-build', 'https://yourwebsite.com/wp-content/plugins/search-filter-pro/public/assets/js/search-filter-build.min.js' );
    }
    add_action('wp_enqueue_scripts', 'search_filter_pro_enqueue_script');

    Replace https://yourwebsite.com with yours of course!

    Anonymous
    #247760

    Hi Trevor,

    I’ve tried adding both the wp_footer function to the footer.php of my custom template, as well as the code snippet you shared to the functions.php file but no luck.

    It doesn’t look like the behaviour has changed at all. The search itself doesn’t seem to be working?

    Anonymous
    #247762

    Hi Trevor,

    Disregard! I managed to get it to work by also including wp_head function into my header.php file.

    Thanks so much for your help!

    Trevor
    #247787

    Thanks for letting me know. I will close this thread for now.

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