Forum Replies Created
-
AuthorPosts
-
vbrains54
ParticipantHi Ernest,
Yes, removing that line fixed it and it is working great!
Thank you very much for your assistance!I have just another quick question:
How would you go about preselecting the first option on those pills to show the user that the filter is active when they first land on the page?I have added `add_action(‘wp_footer’, ‘wp_footer_add_js_button_class_first_selected’);
function wp_footer_add_js_button_class_first_selected() {
?>
<script>
(function(){
document.querySelectorAll(‘label.asp_label’)[0].classList.add(‘asp_label_selected’);}())
</script>
<?php
}`
but for some reason, the first click on the filter is not recognized and only the second click activates the filtering functionality.I would love to be able to fix that and have the first filter option selected by default ( with the new “selected” style applied). But even if it’s not possible it’s all good!
Thank you once again, Ernest!
Kind regards,
Viktor B.vbrains54
ParticipantHi Ernest,
Thank you for the quick solution! That was brilliant!
Unfortunately, while this allows us to style the element behavior exactly as we needed, it breaks the filter’s functionality for this taxonomy.
With the code in place when you click on any of the “pills” ( All, Children, Teenagers, etc. ) the filter is not working.Could the event.preventDefault(); be causing this?
I appreciate your time!
Kind regards,
Viktor B. -
AuthorPosts