• can someone please tell me where to put this code in my wordpress editor where it says javascript i have no ideal where to place it ive tried in the php and css and i get a error

Viewing 1 replies (of 1 total)
  • There are different ways but this should work. Put your script in /uploads and use this code in functions.php for your child theme:

    <?php
    add_action( 'wp_enqueue_scripts', 'add_my_script' );
    function add_my_script() {
      wp_enqueue_script( 'my-js', '/wp-content/uploads/my_script.js', array(), "1", true);
    }

Viewing 1 replies (of 1 total)

The topic ‘where to place javascript code in wordpress’ is closed to new replies.