How to Remove or Modify Page and Post Titles in Twenty Fourteen
Content
Many users of the Twenty Fourteen theme want to customize how titles are displayed on their pages and posts. A common request is to remove the title from a specific page, like the homepage, without affecting other elements like the featured content slider. This article explains why this can be tricky and provides the most effective solutions.
Why is Removing a Title Difficult in Twenty Fourteen?
The primary challenge is that the same CSS class, .entry-title, is used for both page titles and the titles of posts within the featured content grid. Using a broad CSS rule like .entry-title { display: none; } will hide all titles, which is rarely the desired outcome. The theme's structure requires a more targeted approach.
Common and Effective Solutions
1. The Targeted CSS Method (Recommended)
The safest and most common method is to use more specific CSS selectors. Instead of targeting all .entry-title elements, you can target only the titles on pages. The following code can be added to a child theme's style.css file or via a custom CSS plugin.
.page .entry-header .entry-title {
display: none;
}
To target only the homepage and avoid affecting the slider, you can use the page's ID. You can find this ID by inspecting the body tag classes of your page.
.page-id-123 .entry-header .entry-title {
display: none;
}
Note: Replace 123 with your actual page ID.
2. The Template Editing Method (Advanced)
For users comfortable with editing theme files, the title can be removed directly from the template. This method physically prevents the title from being generated in the HTML. This must be done in a child theme to prevent your changes from being overwritten by a theme update.
Copy the content-page.php file from the parent Twenty Fourteen theme to your child theme directory. Then, locate and modify the code that outputs the title. You can conditionally remove it from the front page like this:
<?php
// Page thumbnail and title.
if ( ! is_front_page() ) {
twentyfourteen_post_thumbnail();
the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header>' );
}
?>
Troubleshooting Other Title-Related Issues
- Plugin Conflicts: Some issues, like an extra pipe (|) character in the browser title tab, can be caused by SEO plugins like Yoast SEO. Deactivating plugins temporarily is a good troubleshooting step.
- Removing Author Name: To remove the author name from post meta data, use this CSS:
.entry-meta span.author.vcard { display: none; } - Fixing Broken Titles: If your page displays PHP code like
the_title( ' ', ' ' ); ?>, it indicates a syntax error in a theme file. Restoring the originalcontent-page.phpfile typically resolves this.
Important Best Practices
- Always Use a Child Theme: Never modify the core Twenty Fourteen theme files directly. Using a child theme protects your customizations from being lost during updates.
- Use a CSS Plugin: For simple CSS changes, a plugin like "Simple Custom CSS" is a safe and easy alternative to a child theme.
- Clear Your Cache: After making CSS or file changes, clear your browser and website cache to see the results.
By following these methods, you can effectively manage title display on your Twenty Fourteen theme website.
Related Support Threads Support
-
Site without a tag linehttps://wordpress.org/support/topic/site-without-a-tag-line/
-
Remove title attribute in footer linkshttps://wordpress.org/support/topic/remove-title-attribute-in-footer-links/
-
index.php (or home.php) not used in Twenty fourteen?https://wordpress.org/support/topic/indexphp-or-homephp-not-used-in-twenty-fourteen/
-
How to leave off the Page name at the top of a page????https://wordpress.org/support/topic/how-to-leave-off-the-page-name-at-the-top-of-a-page/
-
Hiding published pageshttps://wordpress.org/support/topic/hiding-published-pages/
-
Unable to Remove Title from Body in TwentyFourteenhttps://wordpress.org/support/topic/unable-to-remove-title-from-body-in-twentyfourteen/
-
Remove breadcrumb on themehttps://wordpress.org/support/topic/remove-breadcrumb-on-theme/
-
Remove H1 title on homepagehttps://wordpress.org/support/topic/remove-h1-title-on-homepage/
-
Category Pages Display only Title and thumbhttps://wordpress.org/support/topic/category-pages-display-only-title-and-thumb/
-
Remove the h1 from Post Navigation….How???https://wordpress.org/support/topic/remove-the-h1-from-post-navigationhow/
-
How can I only show a post's title/image on the front page?https://wordpress.org/support/topic/how-can-i-only-show-a-posts-titleimage-on-the-front-page/
-
Show Titles Only in Search Pagehttps://wordpress.org/support/topic/show-titles-only-in-search-page/
-
Remove "Home" title from front pagehttps://wordpress.org/support/topic/remove-home-title-from-front-page/
-
Remove Post section from bottom of home pagehttps://wordpress.org/support/topic/remove-post-section-from-bottom-of-home-page/
-
want back the titles of my articleshttps://wordpress.org/support/topic/want-back-the-titles-of-my-articles/
-
Remove Author Namehttps://wordpress.org/support/topic/remove-author-name/
-
Removing text on top of all the pageshttps://wordpress.org/support/topic/removing-text-on-top-of-all-the-pages/
-
Doesn't 'get' title on pageshttps://wordpress.org/support/topic/doesnt-get-title-on-pages/
-
How does one multiple h1s from blog home page/https://wordpress.org/support/topic/how-does-one-multiple-h1s-from-blog-home-page/
-
how to trim post title in home page.https://wordpress.org/support/topic/how-to-trim-post-title-in-home-page/
-
2014 Theme Page Titlehttps://wordpress.org/support/topic/2014-theme-page-title/
-
Remove page title from home pagehttps://wordpress.org/support/topic/remove-page-title-from-home-page-3/
-
Remove titles on all pages but not for postshttps://wordpress.org/support/topic/remove-titles-on-all-pages-but-not-for-posts/
-
When remove page-id-title also disappears in the slidehttps://wordpress.org/support/topic/when-remove-page-id-title-also-disappears-in-the-slide/
-
Title (not) in front of featured imagehttps://wordpress.org/support/topic/title-not-in-front-of-featured-image/