WordPress.org

Ready to get started?Download WordPress

Forums

Removing page title on the page (18 posts)

  1. challmich
    Member
    Posted 2 years ago #

    Hello,
    How do I prevent the page title from automatically appearing on the page?
    E.g. On the HOME page, I don't want to see the title HOME. I just want to see text.
    Thanks

  2. mr_director
    Member
    Posted 2 years ago #

    I'd like to know how to do this as well. Does anyone know? The only information I can find is for older versions of WordPress. Those fixes no longer apply.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    This is theme specific. You would need to use CSS to hide the page tiles from graphical browsers.

  4. mr_director
    Member
    Posted 2 years ago #

    I'm just trying to do this on the default Twenty Eleven theme. I want just may main page to have no title showing up right above the page text.

  5. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    check if your theme has a page.php, then remove the title code there.

    if your theme does not have a page.php, you could try to find the title code in index.php and wrap it into a conditional tag ( if( is_page() ) ... )

    you could also try and identify the css selector of the page title, and hide the title using css in style.css.

    and the forum has information about this, even as new as for the current default theme Twenty Eleven ...

    details depend on your theme.

  6. mr_director
    Member
    Posted 2 years ago #

    There is no title information in the Twenty Eleven theme. Unfortunately, I'm not as advanced with WordPress to know how to do conditional phrases.

    I'd do the CSS, but I only want the front page title to be hidden, not all the page titles.

    I've searched for information on Twenty Eleven in the forums, but can't find it.

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

    Create a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  8. mr_director
    Member
    Posted 2 years ago #

    This is what I used on the main page template:

    <?php if ( is_front_page() ) { ?>
    <h2 class="entry-title">Test</h2>
    <?php } elseif ( is_page_template('customPage.php') ) { ?>
    <p>Do Stuff, ignore header on customPage.php</p>
    <?php } else { ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } ?>

    However, that doesn't remove the old title. So now I have two titles on there.

  9. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    edit: reply removed to avoid confusion.

  10. mr_director
    Member
    Posted 2 years ago #

    Figured it out thanks to alchymyth's last comment. Thank you!

    Used this:

    <header class="entry-header">
    
    <?php if ( is_front_page() ) { ?>
    <h2 class="entry-title">Welcome to your new home.</h2>
    <?php } else { ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php } ?>
    
    	</header>
  11. klasg
    Member
    Posted 2 years ago #

    @mr_director, where did you put it?
    I tried to add it in page.php in a child theme
    to twenty eleven...didn't work!

    Rgds
    Klas

  12. mr_director
    Member
    Posted 2 years ago #

    content-page.php

  13. Deedubs
    Member
    Posted 2 years ago #

    I just chopped:

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

    out of the content-page that mr_director suggested.

  14. JonasBang
    Member
    Posted 2 years ago #

    To remove the page title in Twenty Eleven theme on front page only, add following 'if' code to file 'content_page.php':

    <?php if ( !is_front_page () ) : ?>
      <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php endif; ?>

    Then on your front page you can make your own header title with the proper css style like this:

    <h1 class="entry-title">Velcome to my homepage</h1>

    You should ofcourse make a child theme with those changes.

  15. clovis
    Member
    Posted 2 years ago #

    Last week, I deleted the code: <h1 class="entry-title"><?php the_title(); ?></h1> (just like Deedubs) from the content-page.php and it worked like a dream and the page name/title stopped appearing on each page.
    However, I need to do this again because my site went down and I lost a lot of changes, but this line of code is not there in the contents-page.php (e.g. I can still see the space where I deleted it originally) but the page title is showing up again on every page as though no changes have been made to the content-page.php

    Can anyone explain what has happened to my code! When I say my site went down, I mean I experienced the 'white/blank screen of death' and could no longer access/log into my site etc. The site host "reverted my theme (twenty eleven) to the default" so the site was ok again (but with a lot of work lost and default stuff back) but now the code I removed is still 'removed' and I don't see where the page title instruction is being generated from!

    Any ideas how to get around this so I can stop the page title showing up on every page? (or why on earth this is!)
    Thanks!! (total novice)

  16. Scott
    Member
    Posted 2 years ago #

    this worked for me, put it in style.css in my child theme:

    body.home .entry-title {
    	display: none;
    }
  17. dtlyme
    Member
    Posted 2 years ago #

    Brilliant! That css was just what I needed!

  18. djlblair
    Member
    Posted 2 years ago #

    To prevent the page title from appearing on all pages, put the following in the style.css of your child theme:

    .entry-title{
    display: none;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags