Why can't I put site title before page title in browser tab?
-
In Singl’s header.php file, I see the following code:
<title><?php wp_title( '|', true, 'right' ); ?></title>
The result that displays in my browser tab is this:
PAGE_TITLE | SITE_TITLE
What I actually want is this:
SITE_TITLE | PAGE_TITLE
The WP Codex documentation for the $wp_title function explains how to move the separator to the left or right of the post/page title. It also says this:
By default, the separator is displayed before the page title, so that the blog title will be before the page title.
But I can’t get that result. When I modify the code in Singl’s header.php to read as follows:
<title><?php wp_title(); ?></title>
…I should be getting that default behavior… but what I see in my browser tab is this:
? PAGE_TITLESITE_TITLE
…just like that, with no space between the page and site titles.
The Codex entry on $wp_title says that the default is for the site title to go on the left — and that’s what I want. So why can’t I make that happen? Is there some code somewhere in the Singl theme that is overriding this default? If so, how can I change it?
P.S. No need to explain that what I’m trying to do is not considered “best practice”… I’m aware of that. It’s just the style I prefer for my site.
- The topic ‘Why can't I put site title before page title in browser tab?’ is closed to new replies.