• Resolved tcempk

    (@tcempk)


    I’m trying to override a js from my child theme. I created a js folder in my child theme and placed the modified scripts.js in that folder. Now I know I have to call this file from fuctions.php but I don’t seem to get the code right.. this is what I came up with after some research and past experience.

    function oria_scripts() {
    
        wp_enqueue_script( 'scripts', get_stylesheet__uri() . '/js/scripts.js', array(), '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'oria_scripts' );

    I’m using, as seen from the code, a theme called oria.

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

    (@tcempk)

    As it often happens, I found the answer soon after asking the question. Here it is bellow.

    function oria_js() {
        wp_enqueue_script( 'oria_js', get_stylesheet_directory_uri() . '/js/scripts.js', array( 'jquery' ), '1.0', true );
    }
    
    add_action('wp_enqueue_scripts', 'oria_js');
Viewing 1 replies (of 1 total)
  • The topic ‘Child theme functions.php’ is closed to new replies.