WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding margin to theme (4 posts)

  1. Vigil
    Member
    Posted 2 years ago #

    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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <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>

  2. peredur
    Member
    Posted 2 years ago #

    Margins are determined by CSS.

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

    Cheers

    PAE

  3. Steffen Jørgensen
    Member
    Posted 2 years ago #

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

  4. Vigil
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.