1

I am currently working on a child theme with TwentySixteen being the parent.

Currently in the functions.js file of TwentySixteen, it has a break point of 910 where the normal menu stops and the menu-toggle button displays instead.

I need to reduce the width of this down to 810 but am unsure how to do this. Obviously i dont want to touch the TwentySixteen theme files.

0

Copy the js folder of the parent TwentySixteen theme to child theme root. Then add the below code in your functions.php-

function the_dramatist_dequeue_scripts() {
    wp_dequeue_script( 'twentysixteen-script' );
    wp_deregister_script( 'twentysixteen-script' );
}
add_action( 'wp_print_scripts', 'the_dramatist_dequeue_scripts' );

function the_dramatist_twentysixteen_scripts() {
    wp_enqueue_script( 'twentysixteen-child-script', get_stylesheet_directory_uri() . '/js/functions.js', array( 'jquery' ), null, true );
}
add_action( 'wp_enqueue_scripts', 'the_dramatist_twentysixteen_scripts' );

Then in your child theme js folder (the folder you copied earlier) find the functions.js file and make your changes. It will give you the desired output.

  • the_dramatist thanks for this, but now its loading both the scripts one after the other – Will Aug 31 '16 at 16:03
  • Can you please try the edited code ? Hope that's gonna work fine. @Will – CodeMascot Aug 31 '16 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.