Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Bootstrap error
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Joan Alamo Vallejo
Member
Free Members
sp_UserOfflineSmall Offline
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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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

andy-signature.png
YELLOW
SWORDFISH
Avatar
Joan Alamo Vallejo
Member
Free Members
sp_UserOfflineSmall Offline
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...
}

?>

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Joan Alamo Vallejo
Member
Free Members
sp_UserOfflineSmall Offline
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? 

Avatar
Joan Alamo Vallejo
Member
Free Members
sp_UserOfflineSmall Offline
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?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Joan Alamo Vallejo
Member
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2017 - 6:11 pm

You're right 😉

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2017 - 8:52 pm

and did it work?

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10120
Posts: 79605