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.
Related Posts:
- Where and how to put inline js in pages
- Does WordPress Development Mode Exist (with not minified JS)?
- Apply jquery script to only woocommerce product pages and categories
- Run Product Filter Javascript On Page Template
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- Defer all js except certain ones in functions.php file
- Enqueuing Script in functions.php vs on the page
- Properly applying nonce to a form using AJAX
- Clean-up script tags
- Search user metadata with checkboxes via ajax (almost working)
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Why is my Gutenberg block returning an error after initial save?
- jquery won’t load in footer
- How to properly add NPM packages and integrate them in WordPress?
- How to filter a table in post content without plugins? [closed]
- Get Current User info using wp_localize_script, in functions.php
- How to get the post_name when in preview?
- Replace menu links with # and add name to its li
- wp_is_mobile dequeue not working
- Why won’t my scripts load?
- Loading CDN that requires jQuery in WordPress
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- Scripts not appending to element in AJAX call – why?
- call of javascript function to external url always blocked by cors
- Including a specific Javascript Script in a template. Is my code correct?
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- How do I remove the date and category form my portfolio pages
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Javascript function not working when placed in Text Block
- I have problems with loading javascripts
- Adding javascript to functions.php causes problems with my template
- Dequeue script to prevent javascript event conflict on wordpress child theme
- javascript and css links not working on sever
- Run a jquery script on on a certain template page
- Enable right click on WordPress site
- The correct way to add a JavaScript in the functions.php [closed]
- Javascript not loading after the document ready
- Theme JS is available but theme CSS isn’t
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Need help with customalert that it would read on a normal page, but not in WordPress
- How to load jQuery in TOP of wp_footer?
- Include Jquery libraries in wordpress theme?
- Linking Javascript in functions.php file
- Dequeue scripts in IE7 only using functions.php
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Creating multiple category drop down
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- How to setup a popup registeration page in wordpress with function.php
- Custom attributes to javascript tags
- wp_enqueue_script() not working
- How to change text color depending on the number value (Using javascript)
- Add custom taxonomy using JS in post editor
- wp_set_object_term via js btn frontend
- Display Script in Header When URL Variable Present
- Running javascript without hooking wp_head
- Ajax in plugin fails – but only on one blog – no idea why
- How to add javascript code into Divi child theme?
- Changing the default view of “The Events Calendar” for mobile
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Help wiht adding fullcalendar.io to a WordPress page
- Multiple Notifications SetInterval
- Get child-pages slugs of current page into js-file
- admin-ajax.php & my wp-admin folder url showing in header
- Some code is added automatically to my site’s header – what is it?
- wordpress ajax is not working for dropdown selection
- Javascript and Stylesheet in child page
- Automatic add space if user enters number(any digit)
- Search and Replace Script Loader in Head Only Works in Footer
- custom post with loading script per single post
- Why are some custom javascript files working but some are not
- WordPress Javascript Widget jQuery Dependency Issue
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- How do I get my nav menu to show sub pages?
- Why wp_ajax hooks doesn’t work?
- new to javascript – using in instead of functions.php, not loading correctly
- comment_post function with js not running
- Animated Accordion [closed]
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Can’t find function which is called in a wordpress theme
- dynamically import array from another js file in WordPress
- WordPress enque the same script causes the setInterval not to work
- iOS and ajaxComplete
- Missing feature image link function
- Get menu object from theme_location
- Remove images from get_the_excerpt
- Remove “says” from comments
- Reuse variable in hook callback
- Overwrite Parent Theme add_image_size in Child Theme
- Writing functions in WordPress functions.php that don’t replace a WordPress core function
- What happens to the text in functions.php file outside of the php enclosure?
- retrieves menu and converts it to a readable array
- Advanced method to control cache of enqueued style/script
- I’m getting invalid taxonomy in init action
- Rest API User Levels
- How to Update User Meta Field other than from profile?
- More link – not text
- Change TinyMCE undeline outpout