Forums › Forums › Search & Filter Pro › ajax not working
- This topic has 16 replies, 2 voices, and was last updated 10 years, 3 months ago by Anonymous.
-
Anonymous(Private) July 16, 2014 at 9:59 pm #2594
Hi there,
I’m also having trouble with ajax. If I set it as not ajax, the filter works perfectly. I looked over the other threads for possible solutions and tried disabling some plug-ins and changing the content selector without any luck.
The page is here.
I’m using search.php under custom template, and #content for content selector.Thanks!
Ross Moderator(Private) July 17, 2014 at 10:18 pm #2633Hey Kris
I had a look and even the URL is not updating (it is supposed to) so I looks like it may be a JS error…
Can you disable AJAX and so I can have a better look?
Thanks
Ross Moderator(Private) July 21, 2014 at 1:52 pm #2712Hey Kris
Ok, so basically the first thing when you want to use AJAX is to make sure your search page, and the search results page have the same layout (in other words, use the same template).
So on you link above everything looks ok, then you submit the form, and you are taken to a page that looks different.
Basically the way the plugin works is, it take your Ajax selector (for example on the link above, a good choice for selector would be
#content
).. then it loads the results page, looks for#content
, and copies over the content into the current page, inside#content
…The problem is your search results page does not have the same layout or elements so this does not work.
You should try to use a page template for your search results that matches the initial search page (this is
use custom template
in the settings panel), or simply add the IDcontent
to your results page around your posts, then set the Ajax content selector to#content
…Does that make sense? ๐
Anonymous(Private) July 21, 2014 at 3:52 pm #2742OK so I created a custom template and copied the template of the page that the widget is on. But when I use the widget, it basically shows the text of the posts that it’s supposed to show. I’m trying to just get it to show the title, link and an excerpt. Also the widget with the Search Form disappears. I tried changing the content selector from #content to .content-container to .entry-content, with no luck.
Anonymous(Private) July 21, 2014 at 4:19 pm #2743Actually, scratch that. It’s back to not working at all ๐ I thought it started working when I changed “custom template” just to the template of the page, which is the default, so “page.php.” It looked like it was working since the URL updated, but when I went back to check just now it’s back to not working.
Ross Moderator(Private) July 22, 2014 at 1:39 pm #2787Hey Kris if you want to send me your login details I’ll take a look ๐
Ross Moderator(Private) July 24, 2014 at 1:42 pm #2882Hey there, just to let you know I will be looking at this tonight.
Thanks
-
AuthorPosts