Looking for support? You can access the support system via your account.
- This topic has 8 replies, 2 voices, and was last updated 3 years, 10 months ago by .
The topic ‘Unable to enable search on an Archive page’ is closed to new replies.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › Unable to enable search on an Archive page
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…
I’ll also add that I’m using ACF, and am looking to search & filter based on ACF parameters.
Are you able to send me a live link/URL to your search page so I can take a look?
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?
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!
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?
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!
Thanks for letting me know. I will close this thread for now.
The topic ‘Unable to enable search on an Archive page’ is closed to new replies.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy