My blog title and description are both in h1 tags,someone plz help.

6 replies
  • WEB DESIGN
  • |
I am using a wordpress theme which has both my blog title and blog description in h1 header. I want my blog title to be in h1 tags and description to be in h2 tags. I know thats a very basic questions but I dont have any idea about programming.
My header.php file looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if IE ]>
<link rel="stylesheet" href="<?=bloginfo('template_url')?>/style-ie.css" type="text/css" media="screen" />
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" href="<?=bloginfo('template_url')?>/style-ie6.css" type="text/css" media="screen" />
<style type="text/css">
#header_rss img, .post-top h4, #footer{
behavior:expression((this.runtimeStyle.behavior="n one")&&(this.pngSet?this.pngSet=truethis.nodeNam e == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
this.runtimeStyle.filter = "progidXImageTransform.Microsoft.AlphaImageLoade r(src='" + this.src + "', sizingMethod='image')",
this.src = "<?=bloginfo('template_url')?>/images/transparent.gif")this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().repl ace('url("','').replace('")',''),
this.runtimeStyle.filter = "progidXImageTransform.Microsoft.AlphaImageLoade r(src='" + this.origBg + "', sizingMethod='crop')",
this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)
);
}
</style>
<![endif]-->

<?php if(is_single()) : ?>
<script type="application/javascript" src="<?=bloginfo('template_url')?>/js/comment-reply.js"></script>
<?php endif; ?>

<?php wp_head(); ?>
</head>

<body>
<div id="page">

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

</div>
<div id="header_rss">
<a href="<?php bloginfo('rss2_url'); ?>" title="Rss"><img src="<?php bloginfo('template_url')?>/images/rss.png" alt="<?php bloginfo('name'); ?> Rss" /></a>
</div>
</div>

<div id="menu">
<ul>
<li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
<?php wp_list_pages2(); ?>
</ul>
</div>

<div id="body">
<div id="body_top">
<div id="body_left">
<div id="body_left_content">

What changes should I do to this file to make my blog description in h2 and blog title in h1. Someone please help.
#blog #description #plz #tags #title
  • Profile picture of the author ar.anandan
    just go and change the property in your wordpress css file.
    thats all, your problem will be solved.
    else it wont get changed mostly, as many defines properties for many tags inside css file.




    regards
    ar.anandan
    {{ DiscussionBoard.errors[2532012].message }}
    • Profile picture of the author abhijeet024
      Which property you are talking about? I cant get you.
      {{ DiscussionBoard.errors[2532124].message }}
      • Profile picture of the author chriswhiteley
        There is no options within Wordpress to change the actual HTML tags unless you use the editor. You are correct about having to edit the header.php. If you want the blog title to be the H1 and the description to be an H2 all you need to do is change this bit of code:

        Code:
        <h1>
        <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a><span class="description"><?php bloginfo('description'); ?></span>
        </h1>
        to this:

        Code:
        <h1>
        <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
        </h1>
        <h2>
        <span class="description"><?php bloginfo('description'); ?></span>
        </h2>
        I am not sure why you would want to have the description as the H2 as most blog/article headings would be an H2. What you are trying to cook up from doesn't seem semantic to me as the description is just that: a description. It is not really a heading. It's your blog though and you can do what you want!

        Hope this is what you were looking for.
        Signature
        {{ DiscussionBoard.errors[2532391].message }}
        • Profile picture of the author abhijeet024
          Hey Chris,

          Thanks for the info dude. But I have tried this earlier before posting on this forum. I did exactly the same as you are saying. My blog title is a hyperlink with my keyword as the anchor text and after doing this,that hyperlink stopped working. Is there any other method so that I can retain my hyperlink as well?
          {{ DiscussionBoard.errors[2534966].message }}
        • Profile picture of the author ericdpangilinan
          Thanks for this tip, Chris!

          Just what I was looking for!


          Originally Posted by chriswhiteley View Post

          There is no options within Wordpress to change the actual HTML tags unless you use the editor. You are correct about having to edit the header.php. If you want the blog title to be the H1 and the description to be an H2 all you need to do is change this bit of code:

          Code:
          <h1>
          <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a><span class="description"><?php bloginfo('description'); ?></span>
          </h1>
          to this:

          Code:
          <h1>
          <a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
          </h1>
          <h2>
          <span class="description"><?php bloginfo('description'); ?></span>
          </h2>
          I am not sure why you would want to have the description as the H2 as most blog/article headings would be an H2. What you are trying to cook up from doesn't seem semantic to me as the description is just that: a description. It is not really a heading. It's your blog though and you can do what you want!

          Hope this is what you were looking for.
          {{ DiscussionBoard.errors[3366886].message }}

Trending Topics