• When I come up in google, all I am getting is my blogname as the link in google, along with an html title of my short description, is there some trick so that when I am on a id=x page, the title can have the blog post title in the html title so google can pick up on that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The blog post title should be in the google search, if that particular page has been searched and added to Google’s inventory. Do you have it set up so your post title isn’t in the <title> of your posts?

    To set it up so the post title is in the <title> of your posts, you can use:

    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    Which, if your blog was named Blog by Fred and the post or page title was “News from Around the World” would show:

    <title>Blog by Fred - News from Around the World</title>

    You can learn more about these tags at https://codex.www.ads-software.com/Template_Tags

    I’m trying to get the title in my posts to get listed properly and I used the code above, but it resulted in the following…

    Used This Code..
    <title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>

    Getting This Result…
    <title>Sales Freak.com » John & Beckya€?s Movie Review Of Zathura</title>

    I can’t figure out what the $raquo is all about and the #038 and how to get rid of these in the code.

    Any ideas would be appreciated.

    Thanks.

    Scott – would this help?
    https://www.aleeya.net/2005/11/05/optimal-title-plugin-wordpress-and-seo/
    ( ^ A quick write up on how it uses the title)

    ElasticDog’s optimal title plugin?

    @sales Freak
    in the wp-includes / template-functions-general.php is a line
    function wp_title($sep = '&raquo;', $display = true) {
    global $wpdb;
    global $m, $year, $monthnum, $day, $category_name, $month, $posts;

    I would guess that the &raquo; is the >> and is used as a seperator. I am sure there is an easier way to change it, i just dont know how unless you use optimal title and change the varible there (it is the defaul there too, but you can leave it out)

    EstJohn: Thanks for the tip. I’ve put a boatload of time into trying to figure this one out. There are some challenges…

    1. The Header File is actually where you need to change the <title> and not the index.php as many of the posts suggested. However, they are different for every theme, which means if that if you switch themes you have to start over.

    2. The second problem though is what you brought up with the “&raquo”, which I really appreciate because I found where I could delete it in the wp-includes / template-functions-general.php When I deleted it, it up a couple of >> in front of each post.

    3. The plugin didn’t work because it’s tied to the index.php file instead of the header.php and it looks for that crazy &raquo seperator. When I used it and made it work, it started putting the title into the page itself (not good).

    Anyway, I’m still working on it. If you have any additional suggestions, please let me know. Thanks.

    Hmm I am trying to ponder on this one…
    I am using the plugin – optimal title – and I use the header.php for my title where I have
    <title><?php optimal_title('at'); ?><?php bloginfo('name'); ?></title>

    the (‘at’) replaces the >>

    as far as i know it is not tied to anything specifically.. when you activate the plugin, where ever you call the function just uses optimal_title instead of “the_title” – not necessarily index.php

    or maybe i was reading your post wrong?

    Let me try what you’re doing and see if it works.

    It worked. Thanks! Now just one more quick question for you. Whenever a post has the & or ” ” in the title it is putting some funky numbers after it…

    <title>Xelr8 Launches Its New “Eat, Drink & Snack System” at SalesFreak.com</title>

    Any suggestions on how to change that issue?

    Thanks again for your help. I must have messed something up before.

    for & – use &amp;

    I can’t remember what the quote is.. im at work now, will have to check when I get home

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Getting a post title in the html title’ is closed to new replies.