Forums › Forums › Search & Filter Pro › Using ajax: fading but not loading results
Tagged: ajax
- This topic has 11 replies, 2 voices, and was last updated 7 years, 10 months ago by Anonymous.
-
Anonymous(Private) January 16, 2017 at 8:46 am #82531
Hi,
I’m finishing up a website using SF pro, but can’t get ajax loading working, am I missing something?
I’ve currently got a custom post archive file set as the display posts method. The search form is added to this page using a get_template_part(), pointing to a file containing the SF shortcode. The form is nested in a <section>, the results are nested in a different <section>. Results are loaded using the WP loop. Regular non ajax post filtering is working well. However, when I specify ajax and change a taxonomy filter, the page fades but does not update… (I’ve set the ajax container ID to the <section> containing the search results.)
Can you help me figure out what’s going on?
I can create a test account if needed.
Cheers,
Gijs
Anonymous(Private) January 16, 2017 at 12:13 pm #82661Ok! I think I got it working. Adding a <div id=”main-container”> around all content, so just after body tag sorted things out. Don’t know why but it works, both on my demo site and copy. Painfully slow ajax updates though. Any way to speed things up?
Trevor(Private) January 16, 2017 at 12:14 pm #82663This MIGHT work. Try editing that file. Find the line:
<?php get_template_part( 'filters'); ?>
and change it to two lines like this:
<?php get_template_part( 'filters'); do_action('search_filter_query_posts', 42); ?>
42 being the ID number of the form.
Anonymous(Private) January 16, 2017 at 12:23 pm #82665Ha, simultaneous posting… I removed the aforementioned extra containing div and tried your suggestion to see if that would also work. Using the alternative get_template_part code did not resolve the issue. Reverted back to the working version using extra div.
The first element on my page inside the <body> tag was a <header>, now the first element is a <div>. Could this be causing some confusion with SF pro code?
Anyway, thank you for your help Trevor. Pleased all is working now.
-
AuthorPosts