• stevedoig

    (@stevedoig)


    Hi Folks,

    We’re using a Divi child theme.

    In the child theme’s functions.php, we have:

    function sit_divi_scripts() {
        wp_enqueue_script( 'gtm', get_stylesheet_directory_uri() . '/js/gtm.js', array(), '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'sit_divi_scripts' );

    This fails to load the <script> tag on the front-end.

    When I use:

    wp_enqueue_script( 'gtm', get_template_directory_uri() ...

    the front end will load the <script> tag but it points to the parent theme directory, which is not where the script lives.

    Help appreciated.

Viewing 1 replies (of 1 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    If you’re using the Divi theme then you need to avail yourself of their support.

    https://www.elegantthemes.com/forum/

    For pro or commercial product support please contact the author directly on their site. This includes any pre-sales topics as well.

    As the author is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.

Viewing 1 replies (of 1 total)
  • The topic ‘can’t enqueue child theme script’ is closed to new replies.