This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Radio Button Checked State Styling #33509
    vbrains54vbrains54
    Participant

    Hi 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.

    in reply to: Radio Button Checked State Styling #33500
    vbrains54vbrains54
    Participant

    Hi 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.

Viewing 2 posts - 1 through 2 (of 2 total)