Forums

order of the title (8 posts)

  1. Jens Wedin
    Member
    Posted 7 years ago #

    This must be an easy one but I cannot figure it out.

    Today my title looks like this:
    <title>XHTML | CSS | Web design | Photography | Jens Wedin - Strange DNS issue</title>

    First comes the name of the blog then the article name. I would now like to change the order to:

    <title>Strange DNS issue - XHTML | CSS | Web design | Photography | Jens Wedin</title>

    The problem seems to be the <?php wp_title(' - '); ?>. The line (-) always goes after and not in front of the title. If I just write:

    <?php wp_title(' - '); ?><?php bloginfo('name'); ?>

    The line (-) comes before, and I want between the title and name. If I add a static line it show up on the start page and that is not what I want.

    Any suggestions?

  2. Lorelle
    Member
    Posted 7 years ago #

    Did you try:

    <?php wp_title(); ?> - <?php bloginfo('name'); ?>

  3. Kafkaesqui
    Moderator
    Posted 7 years ago #

    This plugin seems to be what you're looking for:

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

  4. Jens Wedin
    Member
    Posted 7 years ago #

    Thanks for the replies, I ´ll try the plugin.

    Lorell: That way, on the frontpage it would show:

    - XHTML | CSS | Web design | Photography | Jens Wedin

    Notice the line (-) in the front. I do not want that.

    Thanks again.

  5. Lorelle
    Member
    Posted 7 years ago #

    <?php wp_title(' | '); ?><?php bloginfo('name'); ?>

    If the article title was "Title of Article" and in the blog name in the Admin you had entered "| XHTML | CSS | Web design | Photography | Jens Wedin", the above template tags (not plugin) would show:

    | Title of Article | XHTML | CSS | Web design | Photography | Jens Wedin

    If you want to totally get rid of anything before the title name put a space:

    <?php wp_title('&nbsp'); ?>

  6. Lorelle
    Member
    Posted 7 years ago #

    Just found out there is a plugin that will help you do what you want and strip the hyphen out: http://elasticdog.com/2004/09/optimal-title/

  7. Jens Wedin
    Member
    Posted 7 years ago #

    Thanks a lot. Using that plugin on my site now.

    http://www.jedisthlm.com

  8. Success
    Member
    Posted 6 years ago #

    I am using this <title><?php wp_title(''); ?></title>

    But on the blog main page, the Title is a blank.

    How can I alter the code so that it only shows Article Title on the blog pages and show the blog name on the main index?

Topic Closed

This topic has been closed to new replies.

About this Topic