• Hi there,

    The title tag of my theme looks like this:

    <title><?php wp_title(”); ?><?php if(wp_title(”, false)) { echo ‘ :’; } ?> <?php bloginfo(‘name’); ?></title>

    but when the page is loaded it produces and empty space here – <title> Site Title</title>

    but that one is not working :

    <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>

    Actually how to change the title on the wordpress to the second one?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Most themes just have something like this in the header.php:

    <title><?php wp_title(‘|’, true, ‘right’); ?></title>

    or

    <title><?php wp_title(‘|’, true, ‘right’); ?><?php bloginfo(‘name’); ?></title>

    But since you already have this, can you please show me the URL you’re talking about so I can see what you’re trying to say, specifically?

    Thanks.

    Thread Starter ilian55

    (@ilian55)

    Hi,

    Currently my wordpress header title looks so:

    <title><?php wp_title(‘|’, true, ‘right’); ?><?php bloginfo(‘name’); ?></title>

    But it displays only the Site Title from General Settings.

    I want to change the header php code to :

    <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title>

    This code displays the Site Title and the Tagline as title on the blog. How to change that code? Do i need to change anything in index.php too ?

    You’re talking about the TITLE of your website (what appears on the browser tab), not the header of your website, right? What’s between the <title></title> tags goes on your browser tab.

    I think you’re thinking about what’s displayed in the header. In that case, you should have something akin to this in your wp-content/themes/yourtheme/header.php file:

    <hgroup>
    <h1 class=”site-title”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></h1>
    <h2 class=”site-description”><?php bloginfo( ‘description’ ); ?></h2>
    </hgroup>

    If not, adjust it as so.

    Thread Starter ilian55

    (@ilian55)

    yes , the PHP code between the <title> tag ?
    That’s what u posted is <h1> ?

    What’s in between your <title></title> tags is what appears on the tabs of your browsers, at the top of the page.

    What I posted, in between the <hgroup></hgroup> tabs is what appears on the top of your webpage … in your header.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to edit the title of the website ?’ is closed to new replies.