Skip to content

Instantly share code, notes, and snippets.

@captprice26
Created October 26, 2016 05:52
Show Gist options
  • Save captprice26/1fac564bd02be6a94022d30495eb7691 to your computer and use it in GitHub Desktop.
Save captprice26/1fac564bd02be6a94022d30495eb7691 to your computer and use it in GitHub Desktop.
For Divi theme accordion open based on URL anchor
//Divi Theme Open Accordion based on Anchor Tag
jQuery(function($){
$(document).ready(function() {
var hashValue = location.hash;
hashValue = hashValue.replace(/^#/, ''); //Get the Hash value from URL
var newText = "#" + hashValue + " h5.et_pb_toggle_title"; //Concatenate the hash value to locate the toggle location
$(newText).click(); //Call the variable with hash and class in it
});
});
@captprice26
Copy link
Author

For Wordpress - Divi Theme only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment