Support » Developing with WordPress » Remove h1/bookmark/page title on certain pages…

  • I am attempting to create custom page title designs for certain pages while hoping that other pages can still use the default h1/bookmark/page title that WP offers. Is there some code I can add to the body of individual pages that will “undo” the page title’s visibility?

    Note: I cannot actually give the page no title because I need the info for the menu.

    Help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sure, you can use conditional tags to optionally output page titles:

    Edit your active theme and change “the loop” to something like this:

    <?php if (!is_page('different')): ?>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <?php endif; ?>

    This will only print the title link for pages which don’t have the slug of “different”. If you want to supress the title for multiple pages, you have to do something like this instead:

    <?php if (!is_page('different') && !is_page('theotherone') && !is_page('yetanotherone')): ?>

    Great! Thanks so much. It works. Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove h1/bookmark/page title on certain pages…’ is closed to new replies.