WordPress.org

Support

Support » How-To and Troubleshooting » i got rid of raquo in title tag but now there is space

i got rid of raquo in title tag but now there is space

Viewing 14 replies - 1 through 14 (of 14 total)
  • Alex Mills (Viper007Bond)
    Participant

    @viper007bond

    http://wordpress.org/support/topic/10515#post-249438

    Umm, there’s no need to go editing core files. The function itself is configurable. » is just the DEFAULT. You can use anything you want.

    http://codex.wordpress.org/Template_Tags/wp_title

    Example: here’s “ :: ” being used: http://www.finalgear.com/news/2005/09/15/

    blueshadow
    Member

    @blueshadow

    i don’t think you understand my question. i don’t want to use any character between anything for the title tag. i want to remove all of the character. as you can see here there is a space in the begining of the title tag.
    <title> Hello world! Hiking Resource</title>

    in the header.php file the title tag look like this
    <title><?php wp_title(); ?><?php bloginfo(‘name’); ?></title>

    what do i do to get rid of the first 2 space?

    blueshadow
    Member

    @blueshadow

    Alex Mills (Viper007Bond)
    Participant

    @viper007bond

    Does this not work?

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

    blueshadow
    Member

    @blueshadow

    nope it does not work. i think there’s another file somewhere but i looked everywhere and can’t figure it out

    blueshadow
    Member

    @blueshadow

    actually when you look at the code on firefox and internet explorerer there is 2 space after the <title>

    Alex Mills (Viper007Bond)
    Participant

    @viper007bond

    Yes, but that’s only in the code. It doesn’t actually show up at the top of your browser or in your favorites/bookmarks. Try it for yourself. Having spaces in HTML is fine and it won’t show up.

    I mean, you could even have this:

    <title>
    Escape to Virginia Beach
    Top Retreat
    </title>

    And it’ll still show up on one line. 😉

    blueshadow
    Member

    @blueshadow

    yes but i think search engine look at it like you see on the browser code with 2 space which is not good for SEO

    same problem here, if anyone comes up with a solution, please, we are waiting…

    Thanks.

    I just solved the problem by using these instead:
    single_cat_title()
    single_post_title()

    anyone found a solution to this?

    Well, it’s not pretty, but you can remove the leading spaces by editing the template-functions-general.php file.

    Change


    $prefix = '';
    if ( isset($title) )
    $prefix = " $sep ";

    to


    $prefix = '';
    if ( isset($title) )
    $prefix = "";

    This has been verified to work in version 2.0.3.

    what makes you think google et al would bother indexing whitespace? that would make for gigabytes of truly meaningless content … especially given some of the shocking HTML that some engines generate 😉

    i really don’t think whitespace in your title tag is that likely to affect your ratings

    if you don’t believe me, view source on this comment 🙂

    bocajuniors
    Member

    @bocajuniors

    I used ardamis fix, with one difference: instead of completely eliminating the $sep variable, I just eliminated the spaces to either side.

    So, I changed:

    $prefix = '';
    if ( isset($title) )
    $prefix = " $sep ";

    to

    $prefix = '';
    if ( isset($title) )
    $prefix = "$sep";

    My title tag now looks like this:

    <title><?php if ( is_single() ) { wp_title($sep = ''); ?> :: <?php } ?><?php bloginfo('name'); ?></title>

    This gets rid of the extra space and adds a “::” after the title of your post, while maintaining no spaces between “<title>” and your blog name if it is your main page.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘i got rid of raquo in title tag but now there is space’ is closed to new replies.