Forums › Forums › Search & Filter Pro › Selected Category not Populating Posts
- This topic has 8 replies, 2 voices, and was last updated 8 years, 9 months ago by Ross.
-
Anonymous(Private) February 6, 2016 at 1:59 pm #36395
Hey all,
I’m very happy with the functionality of the Plugin, especially the Ajax, but when i click the dropdown on my site and select a category which has posts, it refreshes the URL correctly and uses Ajax but doesnt actually filter the posts in that category, it just “flashes” once then remains the same, any ideas what i am doing wrong?
I have inserted my dropdown box in a specific position in my index.php template using:
<?php echo do_shortcode( '[searchandfilter id="140"]' ); ?>
Any help to get this working would be appreciated 🙂
Ross Moderator(Private) February 8, 2016 at 11:26 am #36452Hi Edward, no need to bump, we are just not open on weekends!
So here’s what I can see:
1) Either there are no results for any option in the dropdown or there is some other bug. Enable “auto count” and see what the count number is next to the options for the categories. I’m thinking these might all say
(0)
with auto count enabled? Keep auto count on, and remove any settings you may have in the tabs “Tags, Categories & Taxonomies” and “Post Meta” – does this help?2) In you ajax settings you have chosen the selector
#post
, however when there are no results, this selector cannot be found, causing an issue updating the content after the ajax request.This is a page with no results: http://www.pixeldeck.net/?sfid=140&_sft_category=icons and there is no
#post
whereas http://www.pixeldeck.net/?sfid=140 does have it – so you template needs modification of thisdiv
with the#post
so that it is always present.Thanks
Anonymous(Private) February 8, 2016 at 11:38 am #36456Hey Ross, thanks for the reply!
When I enable “auto count” the dropdown menu changes my categories to (0), but when its disabled, it starts to show (2), (1) etc, next to the respective categories, as i do have various posts in proper categories, however this doesn’t fix the Ajax Updating Issue.
Regarding number 2), I’m not sure what you mean. The #div of #posts stays exactly the same on my index.php file, here is the first line of code:
<div class="posts" id="posts" data-paged="1" style="position: relative; height: 792.952px; opacity: 1;">
If necessary i can provide some login details privately so you can take a look, im sure you could fix it rapidly
Ross Moderator(Private) February 8, 2016 at 4:00 pm #36498Hi Edward
1) In S&F keep auto count on, this is what S&F sees, so its best we figure out why those options are listed as having
(0)
results.After this did you follow the advice?
I’m thinking these might all say (0) with auto count enabled? Keep auto count on, and remove any settings you may have in the tabs “Tags, Categories & Taxonomies” and “Post Meta” – does this help?
2) Just take a look at this search result page I already linked:
http://www.pixeldeck.net/?sfid=140&_sft_category=icons
View the source, this:
<div class="posts" id="posts" data-paged="1" style="position: relative; height: 792.952px; opacity: 1;">
Does not exist, when it should, if perhaps without any results inside.
Thanks
Anonymous(Private) February 8, 2016 at 4:18 pm #36502Hey Ross,
I have enabled auto count and removed any unnecessary settings (i didnt have any anyway, only categories dragged into the search form UI.
Regarding number 2), I see your point, but im not sure why #posts would be removed? I cant target that page because its technically still the blog/home page, and ive checked in index.php and #posts is definitely 100% there.
I’m stumped 😐
Anonymous(Private) February 8, 2016 at 4:21 pm #36504Hey, i got it to work, in the Display Results i set it to index.php as the template and it seems to work now. Now there is a problem where it doesnt load correctly, it loads in a horizontal line! haha, can you help out with THIS issue too? I would love you forever! ha
Ross Moderator(Private) February 10, 2016 at 1:47 pm #36657Hey Edward
You need to find out how to initialise the JavaScript associated with your grid.
Once you know this, you can run it after every ajax request – S&F comes with an event for this found in the first question in the FAQs:
https://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/
Hope that helps!
Thanks
-
AuthorPosts