0
My question probably has an obvious answer, but I couldn’t find it on Google.
I have a site that uses Wordpress. On the site I use a plugin that stopped working (I don’t know the reason). I discovered that the cause was a jQuery that for some reason "wasn’t being used" (I don’t know the right word for it).
I found that this was the problem after I inserted this code in the F12 console and everything worked:
jQuery(function($){
$(document).ready(function(){
$("h3.symple-toggle-trigger").click(function(){
$(this).toggleClass("active").next().slideToggle("fast");
return false;
});
});
});
How to get this code to be loaded along with the page without me having to insert it into the console?
Can you change the HTML? If you have just open a tag
script
and put the code inside it, after setting the jQuery.– Miguel Angelo
Now that I saw that you use Wordpress... in this case you will have to have access to php files of the same.
– Miguel Angelo
Maybe you’re having a conflict between
jQuery(function($) {})
and the$(document).ready(function() {})
, try to remove one or the other and test. If there is no conflict at all, apparently your code is already running and the problem is another.– Eduardo Silva
The @Miguelangelo response solved my problem: Inserted an HTML in the footer with the jQuery code between <script></script> and everything worked. Thank you :-)
– Mateus Bandeira