Support » Themes and Templates » adding margin to theme

  • Resolved Vigil


    I can’t figure out why wp_head is adding a margin to the top of my theme and bumping everything down. Here is the current code I have at the top of my header.php file. The only plugins I have active are Akismet and Under Construction (only allows your site to be seen when you are logged in).

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “”>
    <html xmlns=””>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
    <link rel=”stylesheet” href=”<?php bloginfo (‘stylesheet_url’); ?>” />
    <?php wp_head(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Margins are determined by CSS.

    Please provide a link to your site so that we can look at the styles.



    It makes room for the adminbar in your theme.
    If you don’t use the adminbar, you can add these lines to your functions.php and it will stop adding the margin:

    // remove adminbar
    remove_action( ‘init’, ‘wp_admin_bar_init’ );
    add_action( ‘show_admin_bar’, ‘__return_false’ );

    Thanks, folks.

    I felt real stupid after I realized I could just view my page source and see exactly what wp_head was attaching to my header.

    It was indeed the admin bar. I ended up going into my control panel to turn it off.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘adding margin to theme’ is closed to new replies.