• Resolved jwesseldyke

    (@jwesseldyke)


    Is there any way to take out the “Page Name” on the pages I created? I can’t find the reference in any of the template files, and I don’t want to guess and end up making a mess of the site.

    As it is, at the top of created pages is the title of the page, right below the menu that says the title of the page.

    I just want to launch right into the content of the page without that extra line, in the case of the template I’m using it’s a big font size and just looks bad.

    Thanks for any help…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kafkaesqui

    (@kafkaesqui)

    I assume you mean Pages (as in Write > Write Page).

    What you are looking for is:

    <?php the_title(); ?>

    in your template. Keep in mind it will likely be in a header tag (i.e. <h2>), and possibly acting as a link to the Page.

    Many themes will provide a page.php template for displaying Pages. If this does not exist, WordPress will use the theme’s index.php. If you still want to display the title of posts on your home page etc, two ways around this are:

    1. Set a page.php for your theme. Easiest solution is to copy the index.php or single.php and name it page.php. Then edit this.

    2. Use the following if statement around your title code in the index.php template to display the title everywhere but on a Page:

    <?php if( !is_page() ) : ?>
    <h2><?php the_title(); ?></h2>
    <?php endif; ?>

    In PHP speak ! is a way of saying not, so the if statement says “If we are not on a Page, do the following.”

    Thread Starter jwesseldyke

    (@jwesseldyke)

    Thanks! Worked great. I had seen that tag in the templates, but it was wrapped around code that made me think it had something to do with posts instead of the page title…

    All fixed now… Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘removing “Page Name” from pages’ is closed to new replies.