• Hi

    Currently, the title section of my header.php looks like this:

    		<title>
    <?php if( is_front_page() && is_home() ) { ?>
    <?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>
    <?php } else { ?>
    <?php wp_title(''); ?> - <?php bloginfo('name'); ?>
    <?php } ?>
    		</title>

    Is there a better way of doing this?

    (PS. I’m sorry if this is not the right forum for this kind of questions.)

Viewing 1 replies (of 1 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello makta112,

    Try below code.

    <title><?php 
      if( is_front_page() || is_home() ) { 
         bloginfo('name'); echo '-'; bloginfo('description');
      } 
      else {
        wp_title(''); echo '-'; bloginfo('name');
      } 
    ?></title>

    You can refer this link.

    Hope this will helps you.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Fix header section’ is closed to new replies.