Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Title Help

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #36114
    desttE
    Member

    Hello,

    I have been playing around with my blog titles and notice a small, mainly irritating bug that happens when a WordPress post does not have a headline.

    Right now, my blog displays the title as: My Name / Title.

    <?php bloginfo('name'); ?> / <?php is_home() ? bloginfo('description') : wp_title(''); ?>

    When I view a post that does not have a title, it displays as: My Name /

    Is there a way I can default the title to something I choose?

    Thanks a million,
    Ian.

    #94629
    desttE
    Member

    Anyone? :(

    #94638
    Billy
    Participant

    maybe (I’m really only guessing):


    if (wp_title() == "") {
    wp_title() == "yourwordhere";
    }
    #94647
    Methemer
    Member

    I’m not really sure, can you elaborate on where (what conditions) does this happen ?

    #94649
    desttE
    Member

    It happens on any WordPress post that does not have a title.

    If you have a look here: http://www.inlmbrt.com/2012/01/1171/

    All I’m wanting to do is have some sort of default value if there is no title.

    #94661
    Billy
    Participant

    How about (I’m only guessing)

    <?php bloginfo('name'); ?> / <?php is_home() ? bloginfo('description') : wp_title(''); wp_title() ? : [yourTitleHere] ?>

    I don’t know any of this. Can’t you just give the page a title, and then hide it with CSS by targeting that specific page (the body should have an id specific to it)

    #94691
    TheDoc
    Member

    In what situation would you have a post that doesn’t have a title… ?

    #94703
    desttE
    Member

    Hey cyneWATCH, thanks for the suggestion. Unfourtunately, it didn’t work. :(

    TheDoc: I’m wanting to cover all my bases and also plan on having a few image based titleless posts.

    #94730
    TheDoc
    Member

    There should definitely be no instance where a post or page doesn’t have a title. If you have some cases where you’d like to replace your title with an image, you can certainly set that up through custom fields but it should never be blank. Good to cover all of your bases but to me this is equivalent to making sure a page works with no content on it.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Back End’ is closed to new topics and replies.