WordPress.org

Ready to get started?Download WordPress

Forums

Remove h1/bookmark/page title on certain pages... (3 posts)

  1. ryanleesharp
    Member
    Posted 7 years ago #

    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?

  2. pizdin_dim
    Member
    Posted 7 years ago #

    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')): ?>

  3. ryanleesharp
    Member
    Posted 7 years ago #

    Great! Thanks so much. It works. Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags