WordPress.org

Support

Support » How-To and Troubleshooting » How to ignore the heading of the home page only??

How to ignore the heading of the home page only??

  • Hello all,

    I want to ignore the heading of my home “static” page only and keep the heading on the other pages.

    I know the line to alter is in page.php

    <h2><?php the_title(); ?></h2>

    but it seems not work, I am not a PHP expert, can some tell me the code the do this job please??

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need to create a copy of page.php and call it home.php, removing the call for the title, and WP will automatically use that for your site’s index page.

    Do not delete page.php, and you will need to hard-code in your homepage content into home.php, as this page won’t be able to be edited from the normal write/manage->pages section of admin.

    Other than that, if you know a little PHP, you can use “if” statements to exclude the title from that particular page. I’m just not good at it, so I use the option I mentioned above. Maybe someone else can come in and give you the PHP code.

    Thanks!! thats idea sounds good

    If you were feeling adventurous you could try…

    <?php if (!is_home()){ ?>
    <h2><?php the_title(); ?></h2>
    <?php } ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to ignore the heading of the home page only??’ is closed to new replies.
Skip to toolbar