Blog

08 Sep
2012

WordPress Icon Logo

Hide Title on page content in WordPress


If you want to hide the title from appearing in the content on a page in WordPress then it means editing a theme file. The following is based on the Twenty Eleven theme.

QUICK UPDATE: For the below example you can create a front-page.php in your theme folder instead.

For this example I want to hide the 'Home' which appears on the home page.

1. In the WordPress admin choose
Appearance->Editor
2. Then choose from the list on the right
content-page.php
3. Now find where it says

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

and replace it with

<?php
/* Hide the title on the home page */
if( !is_page( array( 'Home' ) ) )
{
?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
<?php
}
?>

4. You can also list several pages using either their name or id number.

<?php
/* Hide the title on several pages */
if( !is_page( array( 12,'contact','Home' ) ) )
{
?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
<?php
}
?>
Posted in: < CMS >
me@grafxflow avatar

me@grafxflow


I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!

Visitors also viewed these posts


Add comment

Add comment