1

This is my attempt at making a child theme, and everything seems to be working well, however when I view the source code I'm seeing this

<link rel='stylesheet' id='bootstrap-css' href='http://wpdallas.com/test/wp-content/themes/Standard/css/lib/bootstrap.css?ver=3.3.1' type='text/css' media='all' />

which gives me a 404 error. I'm not sure what's going on, and how to fix this....and what problems this could cause me. The site seems to be working fine even with that error. I'm just trying to figure out what it is.

Thanks

  • Look in header.php. Is that stylesheet link hard-coded? If not, it's being enqueued. Find (and post) the wp_enqueue_script() function call that's being used to enqueue the bootstrap-css stylesheet. – Chip Bennett Feb 22 '12 at 21:29
  • I found this code in the functions.php of the parent theme, is that what you were looking for? // bootstrap wp_register_style('bootstrap', get_template_directory_uri() . '/css/lib/bootstrap.css'); wp_enqueue_style('bootstrap'); // style – Rick Smith Feb 22 '12 at 21:42
  • That's the one! – Chip Bennett Feb 22 '12 at 21:48
0

From your comment:

I found this code in the functions.php of the parent theme, is that what you were looking for?

// bootstrap 

wp_register_style('bootstrap', get_template_directory_uri() . '/css/lib/bootstrap.css'); > 
wp_enqueue_style('bootstrap');
  1. In your Theme's file structure, do you find /css/lib/bootstrap.css? If so, then it should be loading properly.
  2. If not, do you find bootstrap.css anywhere else in your Theme's file structure? If so, then you should change the wp_register_style() function accordingly, to reference the correct file location.
  3. If not, do you intend to enqueue the bootstrap stylesheet? If not, then simply remove the code entirely.
  4. Another thing: are you using a Child Theme? If so, then the Theme is looking for /css/lib/bootstrap.css in the Parent Theme, due to get_template_directory_uri(). If you have the files in your Child Theme, change that to get_stylesheet_directory_uri().

Edit

Also, the link doesn't return a 404 for me. I can see the stylesheet, just fine.

  • Thanks for your answer. In the parent theme directory there is is a css/lib/bootstrap.css. Yes, I am using a child theme. I do not have these files in my child theme (this is my first try at making a child theme.) The only thing I have in my child theme folder is wpdallas.com/test/wp-content/themes/Standard-Child-Theme-1/… do I need to make some changes? – Rick Smith Feb 22 '12 at 22:12
  • Right, that link is my child theme css. That's all I have in my child theme folder. However, I'm trying to figure out why I'm getting the error I originally asked about. the css/lib/bootstrap.css error. That link words, but the url isn't ending in .css, it's ending in that strange url thus giving me the 404. – Rick Smith Feb 22 '12 at 22:36
  • "hat link words, but the url isn't ending in .css, it's ending in that strange url thus giving me the 404." - that's the link I'm talking about (and the one I linked). It works just fine. I don't get a 404 error, either with or without the version query string. – Chip Bennett Feb 22 '12 at 22:45
  • No clue; but that's a separate issue from your question, isn't it? – Chip Bennett Feb 22 '12 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.