You’re almost there, change code in functions.php to:
<?php
function my_theme_enqueue_styles() {
$parent_style="divi-style";
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
wp_enqueue_script( 'et_mobile_nav_menu', get_stylesheet_directory_uri() . '/js/selectpage.js', array( 'jquery' ), true );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
Now your script should be located at: /wp-content/themes/divi-child/js/selectpage.js
Related Posts:
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Dequeue script to prevent javascript event conflict on wordpress child theme
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- How to override parent functions in child themes?
- remove_action on after_setup_theme not working from child theme
- Adding a second email address to a completed order in WooCommerce [closed]
- Child theme – Overriding ‘require_once’ in functions.php
- Include files in child theme functions file
- Redeclare a function in a child theme
- How to override a function when isn’t at functions.php
- Child theme functions.php do I use php open and close tags?
- Where and how to put inline js in pages
- Declaring an instance of class included in parent theme from child theme functions.php
- One Child Functions.php for Multiple Child Themes
- Does WordPress Development Mode Exist (with not minified JS)?
- Removing custom background and header feature in child theme
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- Apply jquery script to only woocommerce product pages and categories
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- How to override functions.php in child theme?
- Overriding core functions in child theme
- Override parent theme function that is not hooked or in the functions.php file
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- How to override filter in child theme?
- I created a child theme and it doesn’t work for some of the css files
- Run Product Filter Javascript On Page Template
- add sidebar area to header of child theme
- Unregister Nav Menu with fallback?
- Enqueuing External Javascript functions.php
- Understanding WordPress child theme custom JS loading
- Child Theme Not Overriding Parent Theme
- How to enqueue JavaScript for specific WordPress pages only?
- Changes to functions.php not working
- Overriding methods in a child theme
- Defer all js except certain ones in functions.php file
- How to override enqueued styles using a child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Enqueuing Script in functions.php vs on the page
- Properly applying nonce to a form using AJAX
- Using the child theme functions.php to change the customizer.php on parent theme
- Child theme functions.php not executing
- How to store / access files in child theme folder
- Clean-up script tags
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- Search user metadata with checkboxes via ajax (almost working)
- Overwrite Parent Theme add_image_size in Child Theme
- Why is my Gutenberg block returning an error after initial save?
- jquery won’t load in footer
- Proper way of using functions in action hook?
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- How to properly add NPM packages and integrate them in WordPress?
- how to edit functions.php in a child theme
- Adding tawk.to code just before body tag on functions.php file
- How to filter a table in post content without plugins? [closed]
- Best practice when altering a parent theme function inside a child theme?
- How to make child theme inherit parent custom theme options [closed]
- Get Current User info using wp_localize_script, in functions.php
- Include files in child themes, declare in functions.php
- How to get the post_name when in preview?
- How to remove set_post_thumbnail_size() in child themes?
- Replace menu links with # and add name to its li
- wp_is_mobile dequeue not working
- Avoid loading css from parent theme
- Why won’t my scripts load?
- Loading CDN that requires jQuery in WordPress
- Creating a child theme – functions.php code issue
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- Echo tags used to describe the theme
- Overwriting Parent Theme’s Image Sizes
- Child theme within a child theme?
- Problem only while using require_once() within functions.php
- How can I change a function in a parent theme via a child themes functions.php
- Twentyten Child Theme: header images display messed up in admin panel
- Scripts not appending to element in AJAX call – why?
- call of javascript function to external url always blocked by cors
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- Why is functions.php file in child not initializing and over-writing parent?
- 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?
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- how to en-queue jQuery to load before the tag
- Overwriting the menu break points of twentysixteen in child theme
- Reuse variable in hook callback
- Automatically include all php files in a child theme directory
- How do I remove the date and category form my portfolio pages
- Override the function twentytwelve_scripts_styles in a child theme
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Add custom function to a theme with child theme’s functions.php