Support » Fixing WordPress » How do I hide page titles?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Yes you will have to edit the following line of code in page.php.

    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a> <?php edit_post_link('(edit this)'); ?>

    Thread Starter keebz

    (@keebz)

    I’m sorry. I can’t find the code you’re referring to…

    Here is what my page.php looks like:

    <?php get_header(); ?>

    <div id=”content” class=”narrowcolumn”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <h2><?php the_title(); ?></h2>
    <div class=”entry”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>

    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    Could you specify exactly what I have to change?

    Thanks.

    delete the following:

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

    Thread Starter keebz

    (@keebz)

    Thank you so much! It worked!

    I have the same issue ( I want to hide the page title). However, I can’t find the page.php file. I opened the one in the wp-admin directly, but it doesn’t have any of the code listed above. Is there another file by the same name? I’ve looked in the root directory, themes, content, etc…

    Any help would be appreciated. Thanks.

    I would like to hide the title too and I don’t have the code above. My page.php code is:

    <?php get_header(); ?>
    
    <div id="content">
    
    	<?php include(TEMPLATEPATH . '/loop.php'); ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Thanks,

    Tom

    I would thing Tom that the code you need to edit is in loop.php looking at your code above.

    The bad news is that every template file (index, archive, etc.) is calling the loop.php file, so editing it, will alter ALL the titles!
    That’s why it is an idiotic idea to use the loop.php in any theme: it doesn’t let you to have customized output in different views.
    You either need another theme, or you have to edit all your template files that call the loop.php and instead of calling it – copy its content to replace the call

    <?php include(TEMPLATEPATH . '/loop.php'); ?>

    and then edit the individual template files to behave as you wish.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Agreed, a unified Loop file sucks.

    Just copy all the content of loop.php and replace the include with it, like moshu says. You can do this only on the pages you want to customize, if you like.

    inkedskin

    (@inkedskin)

    Thanks for the info. Very help full.

    This was very helpful, although I deleted everything within the H1 tags and it works great on WordPress 2.7.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How do I hide page titles?’ is closed to new replies.