Support » Fixing WordPress » Removing Page Titles

  • Resolved GreggDoxology


    Ok so I am VERY NEW to wordpress and am using the twentyeleven theme. Here is my question, I want to remove the page titles about the content on each of my pages above my content on my site ( … I searched the forums and found that I needed to take out the following line of code in my page.php file:

    ‘<h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>`

    In looking at the page.php file, I have no line of code like that. What do I do??

    Here is what I have in my page.php file:

     * The template for displaying all pages.
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
    get_header(); ?>
    		<div id="primary">
    			<div id="content" role="main">
    				<?php the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			</div><!-- #content -->
    		</div><!-- #primary -->
    <?php get_footer(); ?>
Viewing 7 replies - 1 through 7 (of 7 total)
  • You might be confused about the term “page”.

    Usually, a web page means “what’s shown inside my browser, duh”.
    However, with wordpress, pages are special posts, static, meant to be just a few and not organized by chronological order, as opposed to posts, numerous and organized on a chronological order basis.

    Try editing likewise the single.php file, chances are it will be for the best 🙂

    Assuming you want to get at the titles of pages and not single posts, like sabinou1 suggested, the file you want is content-page.php. You’ll notice this line in page.php:

    <?php get_template_part( 'content', 'page' ); ?>

    It calls content-page.php to actually insert the page’s content. Twenty Eleven separates out each template file from the actual displayed content like this.

    So I am still not understanding… What do I need to do?

    Look in content-page.php instead of page.php.

    And take out or insert what??

    So I am taking out ‘ <?php get_template_part( ‘content’, ‘page’ ); ?> ‘ ?? Still not sure.

    No, that line is in page.php. You need to look in content-page.php and remove anything similar to what you said you were originally looking for in your original post:

    <h2> title=”<?php the_title(); ?>”><?php the_title(); ?></h2>

    The exact line is:

    <h1 class="entry-title"><?php the_title(); ?></h1>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Removing Page Titles’ is closed to new replies.