Support

Account

Home Forums Front-end Issues Force 1st Accordion Open on Page Load Reply To: Force 1st Accordion Open on Page Load

  • OK, Well, I think I solved my problem. The following code added to the functions file will force the first accordion open.

    add_action('acf/input/admin_head', 'my_acf_input_admin_head');
    function my_acf_input_admin_head() {
    ?>
    <script type="text/javascript">
    jQuery(function(){
      jQuery('.acf-accordion').removeClass('-open');
      jQuery('.acf-accordion:first-of-type').addClass('-open');
    });
    </script>
    <?php
    }