WordPress.org

Ready to get started?Download WordPress

Forums

i got rid of raquo in title tag but now there is space (15 posts)

  1. blueshadow
    Member
    Posted 8 years ago #

    I got rid of raquo in the title tag through wp-includes/template-functions-general.php. but now i don't know how to get rid of the extra space in the title tag. you can take a look at the code. please help http://www.topretreat.com/index.php/escape-to-virginia-beach/

  2. 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/

  3. blueshadow
    Member
    Posted 8 years ago #

    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?

  4. blueshadow
    Member
    Posted 8 years ago #


  5. Does this not work?

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

  6. blueshadow
    Member
    Posted 8 years ago #

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

  7. blueshadow
    Member
    Posted 8 years ago #

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

  8. 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. ;)

  9. blueshadow
    Member
    Posted 8 years ago #

    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

  10. temporaris
    Member
    Posted 8 years ago #

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

    Thanks.

  11. temporaris
    Member
    Posted 8 years ago #

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

  12. muks
    Member
    Posted 7 years ago #

    anyone found a solution to this?

  13. ardamis
    Member
    Posted 7 years ago #

    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.

  14. Chris Burgess
    Member
    Posted 7 years ago #

    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 :)

  15. bocajuniors
    Member
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.