• Resolved Nokaa

    (@nokaa)


    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.

    • This topic was modified 7 years, 7 months ago by Jan Dembowski.
    • This topic was modified 7 years, 7 months ago by Nokaa.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hey @nokaa — thanks for coming back and resolving your topic and explaining how you solved the problem. FWIW, it is not a useless post. I’ve no doubt someone else will have the same problem and your post might help them solve it. If it were truly useless, I could remove it, but I’m leaving it up. It may help someone landing here through search ??

Viewing 1 replies (of 1 total)
  • The topic ‘custom JS script doesn’t work (with contact form 7)’ is closed to new replies.