Skip to content

Instantly share code, notes, and snippets.

@bainternet
Forked from WPDevHQ/custom-functions.php
Created December 7, 2017 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bainternet/ea565b218feed820ddf6a10f83e65eea to your computer and use it in GitHub Desktop.
Save bainternet/ea565b218feed820ddf6a10f83e65eea to your computer and use it in GitHub Desktop.
Keep accordion closed on page load
<?php // Leave this out if you already have an opening php tag in your file!
function elementor_accordion_title() { ?>
<script>
jQuery(document).ready(function() {
jQuery('.elementor-accordion-title').removeClass('active');
jQuery('.elementor-accordion-content').css('display', 'none');
});
</script>
<?php }
add_action( 'wp_footer', 'elementor_accordion_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment