CSS not loading
-
Hello everyone,
I am a student and have to create a website for my company. Actually I do everything local and started to create a index.php and style.css. I already have a problem with this. My firebug says that there is no style.css but I have everything in the same folder and it should work. I used this for embedding the stylesheet:
<link rel=”stylesheet” href=”style.css” type=”text/css”>
I know that this worked with another template I made but I already deleted this one.
It would be so nice if you could help me 🙂
wpnici
-
You can’t put “style.css” in the href. It has to be a full path like “/wp-content/themes/yourTheme/style.css” and you should use a function to get the directory. Or even point straight to the style.css file:
http://codex.ww.wp.xz.cn/Function_Reference/get_stylesheet_directory_uriUse this as guidance for creating your own theme: http://codex.ww.wp.xz.cn/Theme_Development
Is it right this way?:
<link rel=”stylesheet” href=”<?php include( get_stylesheet_directory() . ‘/wp-content/themes/myTheme/style.css’); ?>” type=”text/css”>
No, this is:
<link rel="stylesheet" href="<?php get_stylesheet_directory() ?>/style.css" type="text/css">It still doesn’t work :/
This is what my head looks loke actually:
<head> <meta charset="utf-8"> <title>Arakanga GmbH</title> <link rel="stylesheet" href="<?php get_stylesheet_directory() ?>/style.css" type="text/css"> </head>I don’t understand it because yesterday it worked with the normal HTML embedding.
What error is Firebug giving you?
Firebug says that there is no style defined.
What is the entire error?
Firebug doesn’t say more. The console is empty there are no warnings or mistakes listed. It just says that there is no CSS defined.
Can I embed here pictures somehow? Then I could show the console.
You can link to screenshots. What does your HTML render for this <link> tag?
The Link for the console: http://snag.gy/AvVZK.jpg
HTML says that the URL was not found on the server.
“The link reffering site seems to be wrong or not current.”Can you copy the HTML for your rendered
<link>tag, as seen in Firebug or when you view the source of your Webpage, and paste it here? Thanks.You mean this?
http://snag.gy/pVnAi.jpgIt’s in german :/
The topic ‘CSS not loading’ is closed to new replies.