custom JS script doesn’t work (with contact form 7)
-
Hi,
EDIT : Okay … Finally made it.
I found that we need to use ‘get_stylesheet_directory_uri()’ instead of ‘get_template_directory_uri()’ to get the uri of the child theme…
Finaly works well.
Sorry for the useless post.I tried to add a script to my website to show/hide part of a form (using CF7) when clicking on a “next” or “previous” button in the form. The script work well in local (no WordPress) but it is not recognized by WordPress.
I tried to put it directly in the CF7 editor in <script> tags, didn’t work.
So I tried to put it in the header.php, in the <head>. didn’t work too…
I tried to enqueued my script in the functions.php, but same result…I’ve followed thoses stapes : https://premium.wpmudev.org/blog/adding-jquery-scripts-wordpress/?omtr=b&utm_expid=3606929-101.TxEXoCfwS1KxJG1JVvj_5Q.1&utm_referrer=https%3A%2F%2Fwww.google.fr%2F
But nothing was working.I don’t have any issue in the console, even if I try a “console.log(‘test’)” by example, it doesn’t display it.
I’ve always mentionned the type (text/javascript) in the <script> tags, and replaced ‘$’ symbol by jQuery. But that’s not the problem I think, because even a simple console.log doesn’t work if I only set that.
Can somebody help me ?… I searched for hours and can’t find a solution yet.
A thousand of thank you in advance,
N.C.
- The topic ‘custom JS script doesn’t work (with contact form 7)’ is closed to new replies.