• Resolved vexxatu

    (@vexxatu)


    I have the following tags in my header to display my blog’s name and titles

    <title>

    <?php wp_title(”); ?>-<?php bloginfo(‘description’); ?> > <?php bloginfo(‘name’); ?>

    </title>

    The problem is,when i am on homepage or with no title a dash apears in front like “-description – Blogname”

    How can i get rid of the first dash when there is no title.I want it when it has a title.

    Tnx

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter vexxatu

    (@vexxatu)

    I still didnt managed this issue…i tried some IF commands(i dont know much PHP)..and i cannot remove the – when there is no title

    ideeas?

    tnx


    <title>
    <?php wp_title(''); ?>
    <?php if(wp_title('', false)) { echo ' &raquo; '; } ?>
    <?php bloginfo('name'); ?>
    </title>

    Something like this should work. Replace &raquo; with the “-“.

    Thread Starter vexxatu

    (@vexxatu)

    No,this isn’t what i want…

    If im browsing my categories,title comes in hand and all is ok.

    But if im on my homepage without browsing,title doesn’t exist and my domain looks like this “-blogname”

    With title it’s “Title – blogname” which is good

    All i need is to remove the dash when i dont have a title

    I bet you didn’t try that code sample. ’cause it does exactly what I understand you to be asking for (click my name over there on the left to see it in action).

    Thread Starter vexxatu

    (@vexxatu)

    you bet me wrong..i copied the exact code and it didn’t worked ?? and i double checked

    Thread Starter vexxatu

    (@vexxatu)

    can u paste me the exact <title></title> code that u have?

    <title>
    <?php wp_title(''); ?>
    <?php if(wp_title('', false)) { echo ' &raquo; '; } ?>
    <?php bloginfo('name'); ?>
    </title>

    Looks almost exactly the same as the first chunk you posted.

    This is what I use:
    <title><?php echo (is_home()) ? bloginfo('name') : wp_title('', false) . ' - ' . bloginfo('name', false); ?></title>

    Prints only the blog name on the home page or prints page title, dash and blog name elsewhere.

    It was the same. And, if you compare to what you pasted, you’ll see they’re startlingly similar. And … they do the same thing!

    Thread Starter vexxatu

    (@vexxatu)

    grr…dind’t made it..STILL…anybody with ideeas….and Handy if you’re around..can u paste me your title code pls?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Remove dash when no title?’ is closed to new replies.