treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Wordpress - Titles Not Displaying Properly *PLEASE HELP!!!*

  • The titles on my wordpress site are all messed up. I've tried all night to figure out what is wrong and can't. I want the title to look like so:
    On a page: "Website Name" - "Page Name"
    On homepage: "Website Name"
    On a single blog post: "Website Name" - "Post Title"
    On blog loop page: "Website Name" - Blog

    Instead what I get is:
    On a page: "Website Name" - "Page Name""Website Name"
    On homepage: "Website Name" - "Website Name" "Webiste Description"
    On a single blog post: "Website Name" - "Post Title""Website Name"
    On blog loop page: "Website Name" - "Website Description"

    I tried editing the code in the header.php but couldn't fix it. I tried using SEO Ultimate to replace titles but it had no effect at all, even disabling it didn't change anything.

    My website is: http://www.aarongmoore.com/

    Please help!
  • Thanks Jamy, unfortunately I came across that link (and several similar pages) a few hours ago.

    When I insert:
    <?php bloginfo('name'); ?><?php wp_title(); ?>
    That site says I should get:
    Blog Name » Title of Displayed Page
    But what I actually get is something like:
    Blog Name » Title of Displayed PageBlog Name
    (or Bob's Blog » A Blog By BobBob's Blog)

    I do not understand why this is happening.
  • I've had that problem before... I remember it having to do with the ALL-IN-ONE-SEO pack or something. I'm not too sure, but have a look at this.

    http://www.blog.web6.org/wordpress-all-in-seo-pack-double-blog-title/
  • Tried it. No effect at all.
  • I've gotten it to work a bit better now.

    I essentially "ported" my theme from the HTML website I made last spring into wordpress using the tutorial on this (css tricks) site. So, in other words, my theme is build on top of the Stakers theme.

    I suspect that something in the functions.php of the Stakers theme is preventing SEO Ultimate (I also tried the All In One SEO Pack plugin, same deal) from modifying the titles of pages. I don't understand why, if someone can let me know that would be great.

    More importantly now though, is there a way to customize the $seperator? I'd like it to be '-' or '—' rather than the default '|' but I have no idea where or how to modify this.
  • I've only ever used all in one SEO. You can easily change to '-' or '—'. Why not give it a try?
  • In the functions.php for my theme it uses '$seperator' and by default that appears as '|' and I don't know how to change it. I'm not sure what you meant.
  • Looks similar to SEO Ultimate without as many features.

    Anyway, my last question is about changing the $seperator and not related to SEO.
  • This is the code for displaying the title of a page:
    <?php wp_title( $sep, $echo, $seplocation ); ?>
    As you can see, it has a $sep parameter in it, which you can alter. In other words, you can do the following:
    <?php wp_title('--'); ?>

    to have '--' as the seperator.
  • Like Jamy said, my issue was similar to this but it was the SEO Pack.
  • Bob, thank you for solving my problem!
  • For those of you who are having a similar problem relating to the All In One SEO plugin, comment out the following line in your functions.php theme file:
    add_filter( 'wp_title', 'twentyten_filter_wp_title', 10, 2 );
  • Sweet, thanks!