WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I recently started to learn wordpress theme development and today I started my first worpress theme.For some reason my stylesheet get's loaded in chrome but not in firefox and IE the browsers I am using to test.

Something else I noticed is that it seems wordpress adds some additional styles on its own.Here's what I found on the source page:

<style type="text/css" media="screen">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }

This are not styles I added.

I have tryed to use <?php echo get_stylesheet_uri() ?>

                 <?php bloginfo('stylesheet_url')

But none of theme seem to load the styles.

Here is my entire header code:

   <!DOCTYPE html>
   <html lang="en">
   <meta charset="utf-8">
       <?php if (is_home () ) { bloginfo('name'); }elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }
            elseif (is_single() ) { single_post_title();}
            elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title();}
            else { wp_title('',true); } 
   <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="<?php bloginfo('html_type') ?>" media="screen"/>
   <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" type ="<?php bloginfo('html_type') ?>" />
   <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
   <?php wp_head() ?>
share|improve this question
up vote 1 down vote accepted

Something else I noticed is that it seems wordpress adds some additional styles on its own.Here's what I found on the source page:

When you browse your blog while logged in, wordpress adds 28px margin to top of html/body to make space for their - Wordpress Toolbar

And here's line of code from my theme which is correctly loading stylesheet -

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
share|improve this answer
well it seems that this style is being added to my index.php file.This should not happen right? – Nistor Alexandru Aug 13 '12 at 12:22
it solved the problem of adding the stylesheet but it still still adds the aditional css with from what I know it should not be added on the theme file isen't that true? – Nistor Alexandru Aug 13 '12 at 12:24
if you don't want to show admin mar you can disable it. – amit Aug 13 '12 at 12:25
@user985482 That 28px margin is correctly being added, if that's what you're asking. – tnorthcutt Aug 13 '12 at 12:26
Administration > Users > Your Profile and turn of admin bar to not add those extra stylesheet. – amit Aug 13 '12 at 12:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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