Update bootstrap

If I want to update the bootstrap version (Sydney has 3.3.2 vs. current bootstrap of 4.3.1), how should I go about doing this? The first solution I saw was just replacing the ‘bootstrap.css’ and ‘bootstrap.min.css’ files in /public_html/DOMAIN.COM/wp-content/themes/sydney/css/bootstrap but obviously that’s not ideal since it isn’t in the child theme so it would get changed with the next Sydney update.

Perhaps I could add the files to /sydney-child/css/bootstrap and then have the child theme point to it instead of the Sydney version?

Thanks in advance!

Hi there,

First if you just want to update it because there is new version, then don’t do it, but if you plan to use some new stuff from new version then test all theme parts with new version first.

Bootstrap is added from theme functions.php https://www.screencast.com/t/14rw4uWut so to remove it use child theme and remove it with this function https://codex.wordpress.org/Function_Reference/wp_dequeue_style

After that add similar function to child theme and point to new Bootstrap file inside child theme but use stylesheet directory function like described here (in comments) https://developer.wordpress.org/reference/functions/get_template_directory_uri/ in order to target child theme directory.

Best Regards!