Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Add Bootstrap CSS via the functions.php File

Sarah Jee Watson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 Points

Bootstrap doesn't load.

This worked grand until I moved the site to a staging server. Now Bootstrap doesn't load. I this because I've put it in a subdomain? Is this my problem?

wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true);

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

This might just be the case. Have a look at the URLS your links are pointing to if you can. If they still look like they're pointing to localhost they'll need updating.

You can do this updating the domain by using

<?php

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

?>

Where example.com is your domain plus any sub domains.

Have a look at the Local WordPress Development course on treehouse for tips on migrating websites from local to live servers. :-)

Sarah Jee Watson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Jee Watson
UX Design Techdegree Graduate 28,197 Points

Thank you Jonathan.

All the urls have been updated.

One of the console errors is

Failed to load resource: the server responded with a status of 404 (Not Found) http://mysubdomain.mydomain.com/assets/js/ie10-viewport-bug-workaround.js

I don't have an 'assets' folder. 'assets' should be the name of the folder 'staged'. So the correct path for this file would be: http://mysubdomain.mydomain.com/staged/wp-content/themes/mytheme/js/ie10-viewport-bug-workaround.js

Where does 'assets' come from?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Assets sounds like a project folder that was used to store the original JS and a reference to which was carried over to the site but no longer exists as a folder in your theme,

Try to look for any reference to assets in your relative URLs, remove those and they should work. :-)