Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1030209

    ctcmarketing
    Participant

    Hello,

    I’m trying to make changes to x-head.min.js in my child theme. To do this, I’m following the helpful forum discussion on this topic here.

    I have followed the instructions, copied the js file to a folder in my child theme, and created a function in functions.php to enqueue the script in the child theme and dequeue the script in the parent theme.
    The result is that the child theme x-head.min.js is enqueued, but the parent theme x-head.min.js is not dequeued.

    Here’s the code I’m using:
    add_action( ‘wp_enqueue_scripts’, ‘wpse26822_script_fix’ );
    function wpse26822_script_fix()
    {
    wp_dequeue_script( ‘x-head.min.js’ );
    wp_enqueue_script( ‘x-head.min.js’, get_stylesheet_directory_uri() . ‘/js/x-head.min.js’, array( ‘jquery’ ) );
    }

    Chan you tell me what I’m doing wrong?

    Thank you!

    #1030224

    ctcmarketing
    Participant

    UPDATE! I figured it out. I should have been dequeue-ing and enqueue-ing ‘x-site-head’. Problem resolved! Thank you.

    #1030839

    Darshana
    Moderator

    Glad you were able to figure it out 🙂