Browser title script ignoring is_page /else conditional

I’ve used this code to stipulate different separators for different pages in my clients site:

<title>
<?php if(is_page('Portfolio')){
    wp_title( 'of', true, 'right' );
    echo wp_specialchars( get_bloginfo('name'), 1 );
}else{
    wp_title( 'by', true, 'right' );
    echo wp_specialchars( get_bloginfo('name'), 1 );
}
    ?>
</title>

What it’s outputting regardless of where I am on the site is :

Read More

Page Name | Blog Name

Which i find really odd, how is it going through the if statement and coming up with it’s own answer?

Related posts

Leave a Reply

1 comment