Alexander Solonik
Alexander Solonik

Reputation: 10260

Remove unnecessary header in WordPress

I was just working with WordPress and managed to get my site up. Now I am getting this unnecessary header in my site (the black header ... right at the top), see below:

unnecessary header .

My header code looks like below:

<!doctype html>
<html <?php  language_attributes(); ?> >
    <head>
        <meta charset="<?php  bloginfo('charset');   ?>">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title><?php bloginfo('name');  ?></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">        
        <link rel="stylesheet" href="style.css">

        <?php  wp_head(); ?>

    </head>
    <body <?php  body_class(); ?>>

    <header class="site-header">
        <h1><a href="<?php echo home_url(); ?>"></a><?php bloginfo('name');  ?></h1>
        <h5><?php bloginfo('description'); ?></h5>

        <nav class="site-nav">
            
            <?php  
                $args = array( 
                    'theme_location' => 'primary' 
                );
            ?>    

            <?php  wp_nav_menu($args); ?>

        </nav>

    </header>

I am new to WordPress and just beginning to learn stuff.

How can I remove this header?

Upvotes: 0

Views: 291

Answers (2)

tvdpol
tvdpol

Reputation: 198

Wordpress shows this admin bar by default when you are logged in in the backend. Non-admin users will not see it, but you can disable this in your profile if you want.

Go to Users -> Your profile

Disable the option Show toolbar when viewing site

Upvotes: 2

Manoz Biswas
Manoz Biswas

Reputation: 150

remove this line, the header will goes hide 

<?php  wp_head(); ?> 

Upvotes: 0

Related Questions