Support Forum

Bootstrap error

< 1 2 3 4 >
Yellow Swordfish
Glinton, England
Member
Apr 3, 2017 - 3:05 pm

Probably worth telling the authors that. It is not a problem but is inelegant.

Try - for the sake of testing - changing that word TRUE at the the end to FALSE...

Joan Alamo Vallejo
Member
Gold Members
Apr 3, 2017 - 3:34 pm

I've tried to change a few things in the child's theme functions.php but it always crashes the site (php is not my thing). I'll keep looking on how to do it

Yellow Swordfish
Glinton, England
Member
Apr 3, 2017 - 3:37 pm

So what happened when you changed that to FALSE?
And - by the way - you should probably clear your browser cache after changes and before a test

Joan Alamo Vallejo
Member
Gold Members
Apr 3, 2017 - 3:41 pm

I mean I can't get the functions.php to work 🙁

Something like this should work, isn't it?

<?php

function wf_register_scripts() {

.... code in here...
}

?>

Yellow Swordfish
Glinton, England
Member
Apr 3, 2017 - 5:24 pm

Yes - but I do not know, of course, what you are trying to do.

And - I would still like to know what happened upon changing the last parameter to false. That should have switched the load order...

Joan Alamo Vallejo
Member
Gold Members
Apr 3, 2017 - 5:40 pm

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? 

Joan Alamo Vallejo
Member
Gold Members
Apr 3, 2017 - 5:49 pm

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?

Yellow Swordfish
Glinton, England
Member
Apr 3, 2017 - 6:04 pm

I don't understand why you are going to all that trouble. I was just suggesting you change the original temporarily to see if that resolved the issue. If it does then the decision can be made on how to tackle it...

Joan Alamo Vallejo
Member
Gold Members
Apr 3, 2017 - 6:11 pm

You're right 😉

Mr Papa
Simi Valley, CA
Member
Free Members
Apr 3, 2017 - 8:52 pm

and did it work?

< 1 2 3 4 >