• I am migrating several websites from Webflow, but building some custom code and I’m having trouble migrating JS. I read that custom JS could be enqueued and have done soin the functions.php file.

    The enqueuing seems to work, but none of the interactions or functions on my JS work. This is the code I used to enqueue:

    add_action('wp_enqueue_scripts', 'tutsplus_enqueue_custom_js');
    function tutsplus_enqueue_custom_js() {
        wp_enqueue_script('custom', get_stylesheet_directory_uri().'/scripts/custom.js', 
        array('jquery'), false, true);
    }

    Any ideas on how to solve this?

Viewing 1 replies (of 1 total)
  • Hey @fvl1987,

    Is the script being enqueued to your website? You should see the source code of the website and click on the script source to make sure it’s the right URL.

    And rest it really depends on your JS. If it’s loading properly but not working, it has to do something with the JS, not the PHP side of things.

    Hope it helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom JS to WordPress’ is closed to new replies.