Tell us what you are trying to do?
The URL contains the ID of a post being displayed in and accordion. I am trying to get the relevant card to open automatically when the page is accessed with the anchor. I had this working on another toolset site, but this is no longer working, and js is not exactly my forte
the script looks like this:
jQuery(document).ready(function() {
var url = document.location.toString();
if ( url.match('#') ) {
var hash = url.split('#')[1];
When I try to run it. it get the following in the console
Uncaught TypeError: $ is not a function
at HTMLDocument.<anonymous> ((index):3662)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
Without all this, the accordion works perfectly fine
btw, where would be the correct location in the view to add the js? Does it matter?
Is there any documentation that you are following?
all over the internet. I've tried various things
Is there a similar example that we can see?