Support » Requests and Feedback » wp_title — allow separator before blog title

  • For single entry post pages, I like putting the post title before the blog title in the HTML title element. For me, it it just helps keep track of things easier.
    The wp_title template tag is very nice, but currently there is no option for putting the separator before the blog title.
    If you have a separator, it goes after the blog title, not before. As my blog title appears after the post title in single post pages, I can’t use a separator, as it would just be at the very end of the of the title, and thus not helpful
    Current: Title of post Title of blog >>
    Ideal: Title of post >> Title of blog

Viewing 7 replies - 1 through 7 (of 7 total)
  • Mark (podz)


    Support Maven

    I think it’s because everything is heirarchical, and with your blog being at the ‘top of the tree’ …..

    Mark Jaquith


    WordPress Lead Dev

    If you’ve any skill with PHP, I’d recommend writing your own breadcrumb function. Take a look at the default WP one, and change it too your liking, and then save it as a different function.

    I have the same issue, and here’s how I solved it.
    In wp-includes\template-functions-general.php, I changed line 132 to read as follows.
    echo “$title $sep “;
    And line 134 to read as follows.
    return “$title $sep “;
    Then in my template I changed the title tag to look like this.
    <title><?php wp_title(); ?> <?php bloginfo(‘name’); ?></title>
    That did it.

    Hi Greg!
    I too have been trying to figure out what to change in the templates to reverse the page title for single entry post. (So that the post title comes before the blog title.)
    If I make the changes that you recommend, will it automatically update the current postings? Or, will I end up with some broken links? I am wanting to make the changes on the following site:
    Thank you in advance for any pointers you can give me on this! : – )

    Update on my request—
    I tried the changes that Greg recommended and it worked perfectly!
    Many thanks for the help!!!

    In WP 1.5 same dealies can be found on lines 180 – 184

    There is also a plugin for this, for the code skittish:

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘wp_title — allow separator before blog title’ is closed to new replies.