wp_title -- allow separator before blog title (8 posts)

  1. awh
    Posted 12 years ago #

    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

  2. Mark (podz)
    Support Maven
    Posted 12 years ago #

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

  3. Mark Jaquith
    WordPress Lead Dev
    Posted 12 years ago #

    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.

  4. Anonymous
    Posted 11 years ago #

    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.

  5. cricket
    Posted 11 years ago #

    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! : - )

  6. cricket
    Posted 11 years ago #

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

  7. soupenvy
    Posted 11 years ago #

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

  8. Kafkaesqui

    Posted 11 years ago #

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


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.