WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. awh
    Member
    Posted 9 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.
    http://wiki.wordpress.org/wp_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
    Example:
    Current: Title of post Title of blog >>
    Ideal: Title of post >> Title of blog

  2. Mark (podz)
    Support Maven
    Posted 9 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 9 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
    Unregistered
    Posted 9 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.
    Greg

  5. cricket
    Member
    Posted 9 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:
    http://www.blog.website-development-training.com/
    Thank you in advance for any pointers you can give me on this! : - )

  6. cricket
    Member
    Posted 9 years ago #

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

  7. soupenvy
    Member
    Posted 9 years ago #

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

  8. Kafkaesqui

    Posted 9 years ago #

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

    http://elasticdog.com/2004/09/optimal-title/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.