Support Forum
I wanted to declare the same function as in the parent functions.php to change what you said, but it crashes.
The parent looks like this:
function wf_register_scripts() {
...
wp_enqueue_script('bootstap', get_template_directory_uri().'/assets/js/bootstrap.js', 'jquery', '1.0', TRUE);
...
}
add_action( 'wp_enqueue_scripts', 'wf_register_scripts' );
Maybe I need to remove the action and replace it with another one?
Looks like I made it work doing this:
function remove_my_parent_theme_function() {
remove_action('wp_enqueue_scripts', 'wf_register_scripts');
}
add_action('wp_loaded', 'remove_my_parent_theme_function');
function my_wf_register_scripts() {
...
wp_enqueue_script('bootstrap', get_template_directory_uri().'/assets/js/bootstrap.js', 'jquery', '1.0', FALSE);
...
}
add_action('wp_enqueue_scripts', 'my_wf_register_scripts');
How does it look?
1 Guest(s)