Hide search and filter in toolset archives on load and reveal it when clicking on a button.
Link to a page where the issue can be seen:
hidden link hidden link Clicking the "Filter" button at the top revels the filters momentarily but then resets the classes.
I expected to see:
I have set up the following javascript to reveal the search and filter on clicking the "filter" button. So I expected to see the search and filter controls revealed after clicking the button.
Hello. Thank you for contacting the Toolset support.
Can you please share admin access details and let me see whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I'm not sure whats going on here as when I check the archive once the archive loaded it keeps updating archive automatically for 7-8 times and that is why when you click on the "filter" link it will show you the filter form for a moment and then suddenly disappear.
If you load the archive and then wait for 30 seconds and then if you click on the "filter" link, it is working as expected.
This is not a normal behavior. Archive should not keep updating for 7-8 times. Did you added any custom scripts? If no:
Can you please try to deactivate plugins one by one and check if you able to find any plugin causing the conflict.
Hi, thanks for checking on this. I did not add any script that I know of that could cause this problem. I removed all the custom js and checked, but that did not fix the issue for me. What is even more curious is that certain archives do not experience this issue such as hidden link . As you might notice, I have copied the site onto a staging link, you can login with the same credentials as the main site. Please let me know if you are able to discern anything more about the issue.
I see the difference between the filters you added.
With the following archive - I do not see any checkboxes filter added as button: hidden link
But on this archive page: hidden link
- You added the checkboxes filters as buttons. Please check the following screenshot: hidden link
Toolset do not offer any way to display checkboxes as buttons you must have added some script to make checkboxes as button. What if you remove that filters for a moment and see if you able to see the toggle working as expected. If you found it working then you know that the issue is from the checkboxes filter you added as buttons.
As shared, this is not a normal behavior at all and there is some conflict either JS or any other custom code you may have added to your site as if you create a new archive using Toolset, it will not behave such like updating archive for 5-8 times for 30-50 seconds.
please check this page where I have removed all scripts and css for the taxonomy buttons : hidden link . The issue is still there. Also, you will notice the issue on this page as well where no buttons are used for the taxonomy: hidden link . I have also deactivated all non toolset plugins and removed all scripts other than the following that might be causing the issue.
Sorry for the delay, I couldn't find the time to remake the archive till today. Here it is: hidden link . Remade it from scratch, but the issue is still present unfortunately. Please help with further debugging, thank you!
I've made change to your live site after finding the fault on the staging site. You were using wrong pagination option. I've set the pagination option to "Pagination enabled with manual transition and page reload" and I can see its working now. Can you please confirm it works at your end as well.
Ok. I've added the following code "Custom JS" section of the archive to your staging site and also set the pagination method to "Pagination enabled with manual transition and AJAX" and 6 result per page with infinite scroll. Please check the following screenshot: hidden link
jQuery(document).ready(function () {
jQuery(".show-more").click(function() {
jQuery(this).addClass("hidden-item");
jQuery(".more-content").removeClass("hidden-item");
});
jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
/**
* data.view_unique_id (string) The View unique ID hash
* data.effect (string) The View AJAX pagination effect
* data.speed (integer) The View AJAX pagination speed in miliseconds
* data.layout (object) The jQuery object for the View layout wrapper
*/
jQuery(".show-more").click(function() {
jQuery(this).addClass("hidden-item");
jQuery(".more-content").removeClass("hidden-item");
});
});
});
Can you please confirm it works as expected: hidden link