• Resolved bduenskie

    (@bduenskie)


    I’m looking to remove the page title header if the page is my homepage, I’ve tried the following code but to no avail:

    <h2><?php if (the_title != "Homepage") echo the_title() ?></h2>

    Any help would be most appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bduenskie

    (@bduenskie)

    Nevermind, found using get_the_title() worked.

    I am trying the above, to remove the title from one page. But need some help to get it working. I am using the mandigo theme, which looks like:

    <<?php echo $tag_posttitle_single; ?> class="posttitle"><?php the_title(); ?></<?php echo $tag_posttitle_single; ?>>

    Using:
    <h2><?php if (get_the_title != "Homepage") echo get_the_title() ?></h2>
    Won’t work either…

    Did you resolve this? I’d think something like…

    <h2><?php if (get_the_title() != “Homepage”) echo get_the_title() ?></h2>

    Worked for me thanks zoinks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘remove page title based on if statement’ is closed to new replies.