• Resolved phinn

    (@phinn)


    right now i am using the following code to show my page titles in a separate area:

    <h1><?php echo get_the_title(); ?></h1>

    which works dandy for my regular pages, but on all the blog post pages it uses the post title.
    now i’d like to see if i can get any pointers on how to add a condition so that on all individual blog post pages it will instead just say “News”, kind of like this:

    <h1><?php if(not blog post page){ echo get_the_title(); } else { echo 'News';} ?></h1>

    i’m just having trouble figuring out what i should put in the parentheses to properly call what i’m looking for.
    thanks

Viewing 1 replies (of 1 total)
  • Thread Starter phinn

    (@phinn)

    <h1><?php if(!is_single()){ echo get_the_title(); } else { echo 'News';} ?></h1>
    figured it out if anyone else needs it.

Viewing 1 replies (of 1 total)
  • The topic ‘Keep a separate constant title on all individual blog post pages’ is closed to new replies.