WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can't change title separator on homepage? (2 posts)

  1. crispyollard
    Member
    Posted 11 months ago #

    Hey.

    I've got a bit of an issue with using the blog name and title separator. Here is my code as from the theme I'm using which I have edited to implement a '|'.

    <title><?php
    
    	if ( is_search() ) { echo "Search for $s"; }
    
    	if ( is_404() ) { echo "404: Page Not Found"; }
    
    	wp_title('|');
    
    	if ( is_archive() ) { echo " archive "; }
    
    	if ( !is_home() ) { echo " at "; }
    
    	bloginfo('name');
    
    ?></title>

    This works on all pages except the homepage. My homepage simply displays:

    blogname - tagline

    There is no | in sight. Forgive my novice PHP head. I assume the fix is very simple. Can anyone help?

  2. crispyollard
    Member
    Posted 11 months ago #

    As I hit Post I realise that nothing is wrong apart from my stupidity at setting a custom title with Yoast's SEO plugin which overrides the title. Ho ho.

    Remove the post if required. Or leave it to laugh at me. ;)

Reply

You must log in to post.

About this Topic