Carolyn E. Cooper Communications

Helping people prosper in the New Economy with humor and passion

How to get rid of the blog title and description in the Wordpress header

Posted on | July 1, 2009 by carolyn

Thanks for you very helpful tips and informative answers to questions. I am in the very early stages of building my WordPress blog and with your help I was successful in replacing the default header with my own. The problem I now face is that my new header contains my blog title, so I want to hide the default blog title and tag line from display. (they now overlap) Is there a “coding” way to do that other than blanking them out in my general settings?

Your advice would be most helpful

Thank you
Warren

Warren, I’m delighted to help. What is happening is that the blog title and tagline (also known as the description) are still part of your header.php file.

Step 1: Make a Back-up Copy of Your header.php File

Load the header.php file from your selected theme in the HTML editor of your choice (remember, never use MS Word or other Microsoft text editor except Wordpad). Now do as “save as” and give the file a new name like “header-backup.php”.

This is could policy whenever you are changing code in a critical file.

Step 2: Find the Blog Title and Description Code in Your header.php File

Once again, load the header.php file from your selected theme in the HTML editor of your choice.

Find the code that includes the terms “bloginfo(‘name’) and bloginfo(‘description’).
In the default Wordpress template it looks like this:

<h1><a href=”<?php echo get_option(‘home’); ?>/”><?php bloginfo(‘name’); ?></a></h1>
<div><?php bloginfo(‘description’); ?></div>

“bloginfo(‘name’)” is the Wordpress variable that writes whatever you put as your blog title in your General Settings. “bloginfo(‘description’)” is the Wordpress variable that writes whatever you put as your tagline in your General Settings. The HTML code that contains those two variables is what is writing your blog title and tagline in your header.

They’ve got to go.

Step 3: Remove Blog Title and Description Code in Your header.php File

Now you have two options.

Option 1: delete the code. Yep, just highlight and delete the lines containing the bloginfo(‘name’) and bloginfo(‘description’).

Option 2:comment the code out. “Commenting out” means adding some characters that tells the browser to ignore everything between the specific tags. In HTML, the starting tag is <!- -  and the ending tag is – ->. Below is how the default theme header.php would look if you commented out the blog title and tagline code.

<!-- This is the tag that starts commenting out the rest of the code

<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div><?php bloginfo('description'); ?></div>

And this is the tag that ends the commenting out -->

Once you've eliminated the lines of code that include your bloginfo from your header.php, you problem should be solved.

And thanks again, Warren, for reading the site and asking the question.

One Response to “How to get rid of the blog title and description in the Wordpress header”

  1. Val | August 17th, 2009 @ 9:33 pm

    Hello. I was thrilled to see this advice. I tried it. Nothing changed. I also see the following code and wonder if that needs to be altered.


    <!-- Begin navigation -->

    <a href="/">Welcome</a&g

    <!--End navigation -->

    Thanks.Val

Leave a Reply





Bad Behavior has blocked 246 access attempts in the last 7 days.