• Resolved Vigil

    (@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” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml”&gt;
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
    <title></title>
    <link rel=”stylesheet” href=”<?php bloginfo (‘stylesheet_url’); ?>” />
    <?php wp_head(); ?>
    </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.

    Cheers

    PAE

    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’ );

    Thread Starter Vigil

    (@vigil)

    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.