I am working on a WordPress theme and I want to edit the page where the title headers are located. (To be more specific, I am working on the’twenty thirteen’ theme). Now, I only want to remove the title in the home page which says ‘Home’. However, I cannot do that because that would remove all the titles in all the pages. So I have to make an if/else statement. The problem is nothing is working with me – pasted below is the code:
<header class="entry-header">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
As I found out function
the_title()
give you the page title. simply use this and put your html code between if block to customize it.You can achieve that by using the
is_home()
method.Here is the reference to the method.