How To Disable Home/Front Page Title In Front Page-WordPress

How To Disable Home/Front Page Title In Front Page-WordPress. It’s a very common question people ask when designing a WordPress theme regarding to remove/hide the front page title, from the homepage. This is often asked in situations where a static page is being used for the Home Page.

How To Disable Home/Front Page Title In Front Page-WordPress

There are some solution that is we discussed here, all these are

Trick No. 1:

You will need to create a separate page template for the homepage or edit the default page template (page.php in your theme’s folder) and delete this:

<?php the_title(); ?>

Trick No. 2:  

Add this in header.php

<?php
if(is_page('your static page title or slug')) ?>
<style>
h1
.entry-header{display:none !important}
</style>
<?php } ?>

source from 

Trick No. 3 

Hide the Page Title with CSS

This is the most common method. It works by creating a class in your theme’s style.css file, something like this:

h1#post-63 {display:none;}

You should replace the “post-63″ bit to match the ID of your own WordPress page ID. (TechTrot explains how to find your page ID here).

Trick No. 4 

Remove the Page Title with a WordPress query

Using the WordPress conditional tag “is_front_page()” you can make your WordPress theme check if the current page is the “home page” or as WordPress calls it “the front page”.

The query you should place into your theme’s page.php file looks something like this:

<?php if (is_front_page()) : ?>

<?php else : ?>
<h1 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h1>
<?php endif; ?>

 

Trick No. 5

 Change the Page Title with a Plugin

Used plugin “Page Lists Plus”. With this plugin, you can control the Page Title text that is displayed in your navigation menu (Page lists generated by wp_list_pages()).

Trick No. 5

Delete the Page Title with Page Templates

As noted in Saban’s comment, you could create a Page Template that excludes the_title() all together.

As a rough guide to do this, follow these steps:

Go to your theme directory via FTP, download and make a copy of the page.php file and rename it to something like “page-notitle.php“

Open the page-notitle.php file and add to the very start of the document some code to identify it as a template:

<?php
/*
Template Name: Homepage (No Title)
*/
?>
`

Next, browse through the document until you find the_title() – this is the area that displays the page title. For example, it would be fine to remove the following (but your theme may differ!):

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

Save and Upload your new page-notitle.php file to your theme directory.

Now return to your WordPress admin area and edit the page you’re using for the homepage. On the right hand side under the Publish panel you’ll see Page Attributes > Template, and select the “Homepage (No Title)” option. Update the page and you’re all done.

With this method you have a page template that can also be used in other area’s of your website.

Leave a Reply