• Resolved cyrussh

    (@cyrussh)


    Hi there,

    I have added my custom is file in my child theme folder and register it in my function but, unfortunately it does not load. In addition if I include the same js in the theme directory it works with get_stylesheet_directory_uri() perfectly.

    I know that my code has no issue as works in theme directory but I am going to include it here:

    (function($){
    $(document).ready(function() {
    setTimeout(function() {
    $(‘body’).addClass(‘loaded’);
    }, 3500);
    });
    })(jQuery);

    and register it in my child function:

    /* Pre-Loader Start */
    function Pre_Loader_enqueue_scripts() {
      wp_enqueue_script( 'pre-loader', get_stylesheet_directory_uri() . '/assets/tobi/Custom-js/preloader.js', array('jquery'), '1.0.0', true );
    }                                                               
    add_action( 'wp_enqueue_scripts', 'Pre_Loader_enqueue_scripts' );
    /*Pre-Loader End */

    Your help will be highly appreciated!

    Cyrus

Viewing 1 replies (of 1 total)
  • Thread Starter cyrussh

    (@cyrussh)

    ***Sorry for the miss typing I mean js file in the first paragraph and get_template_directory_uri() in the second paragraph.***

Viewing 1 replies (of 1 total)
  • The topic ‘Js file linked in Child them does not load’ is closed to new replies.