Skip to content

Instantly share code, notes, and snippets.

@xy0
Created January 17, 2018 16:16
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 xy0/753c61bfb8e270ee48a4fb4f6659be32 to your computer and use it in GitHub Desktop.
Save xy0/753c61bfb8e270ee48a4fb4f6659be32 to your computer and use it in GitHub Desktop.
Use JS to change + to - in your WP accordions.
$('.panel-heading').click(function(){
$('#ew-accordian').find('a').each(function(){
$(this).attr('data-before','+');;
});
if( $(this).find('a').attr('aria-expanded') == 'true' ) {
$(this).find('a').attr('data-before','+');
} else {
$(this).find('a').attr('data-before','-');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment