Hi, I know that you can set an accordion to be open but when a person has opened a different one and goes back it remembers which they had open.
I would like to force the first accordion open on page load no matter what. I figure there are two options here.
1 – Force with JavaScript, or
2 – can I link directly to an accordion?
Any ideas?
P.S. this is for a front-end form.
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
}