• Resolved petrachappell

    (@petrachappell)


    Hi there,

    I’m having issues with my WordPress title – the one that comes up on the top of the internet browser window or in tabs (I don’t know the proper name for it!). There seems to be no space/separator between the post title and my site title in this location – not sure why this is happening and I’m sure there is an easy fix!

    My site is https://www.theglobalcouple.com, if you have a look you’ll know what I’m talking about.

    Any help would be appreciated! I’m pretty new to web stuff so I hope it’s a quick fix!

    Thanks so much ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • graphicscove

    (@graphicscove)

    Hello petrachappell,

    Is this a template you have brought or did you create it yourself? You can edit the title separator by adding in a parameter to the wp_title code in your header.php. More information can be found here: https://codex.www.ads-software.com/Function_Reference/wp_title.

    I see the separator currently works on your homepage. Do you have your header.php code we could have a look at to see what’s going on?

    Kind regards

    Thread Starter petrachappell

    (@petrachappell)

    Hi graphicscove,

    Thanks for your comment.

    I bought this template. I have had a look in the header.php file and here is the code that I think is related to the title:

    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'fairpixels' ), max( $paged, $page ) );
    
    	?>
    </title>

    The separator is working between the site title and the tagline (ie. the | between The Global Couple and Travel & Photography blog), but you can see there is no space or – between Home and The Global Couple (that’s what I’m wanting to add in).

    I appreciate your help and time! ??

    Try inserting this extra code line to print the space:

    wp_title( '|', true, 'right' );
    print ' ';
    // Add the blog name.
    bloginfo( 'name' );

    However, header.php is going to be overwritten by theme updates.

    Consider using this plugin:
    https://www.ads-software.com/plugins/wordpress-seo/
    At Admin page > SEO > Titles and metas, you get full control over your title text, independent of theme updates or even of theme.

    Thread Starter petrachappell

    (@petrachappell)

    Thank you lorro!

    Adding the extra code worked perfectly. I’ll just need to remember to update it after theme updates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to edit WP-title separator? WordPress newbie…’ is closed to new replies.