• Resolved cableghost

    (@cableghost)


    I am trying to remove the title from just my home page.

    My page.php includes the following script: <?php the_title(); ?>

    I have tried replacing it with the following code, however, the title still appears:

    <?php if (is_home() ) { /*Do nothing*/ } else { the_title(); } ?>

    What may I be doing wrong here?

    -Scott

Viewing 6 replies - 1 through 6 (of 6 total)
  • Your “home” page is generally controlled by your index.php file.

    You might look for something similar in that file as a starting point.

    The Codex offers some possible answers. i.e. – is_home may be returning False for your home page.

    ref. – http://codex.wordpress.org/Conditional_Tags

    is_home()
    When the main blog page is being displayed.

    Note: If you select a static Page as your frontpage, this tag will be applied to your “posts page”.

    Thread Starter cableghost

    (@cableghost)

    cais- thank you. I did try that first, same result, so I thought it was my page.php.

    adiant- thank you. so if I am using another page as my static page, what would I replace is_home() with, the page ID of the static page?

    Yes, I’d stick with Page ID, as pretty much anything else can change.

    From that same page of the Codex:
    is_page(’42’)

    You might find possible success with a slight adjustment to your code:

    <?php
     if (is_home() ) {
       /*Do nothing*/
     } else {
       the_title();
     } ?>

    changed to this:

    <?php if (is_home() || is_front_page() ) {
       /*Do nothing*/
     } else {
       the_title();
     } ?>

    Thread Starter cableghost

    (@cableghost)

    Perfect, thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Remove Home Page Titles’ is closed to new replies.