Fixing the blog page title in WP

If your blog page is pulling the title of the last/latest post, here is a quick and dirty fix

Add this to your title tags:

<?php elseif ( is_home() ): ?>

Examples:

<div class="container">
<?php if( is_page() ): ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php elseif ( is_single() ): ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<?php elseif ( is_home() ): ?>
<h1 class="entry-title white">Resources</h1>
<?php endif; ?>
</div>
Isaac Adams-Hands

Full Stack Developer, Digital Marketer, and InfoSec enthusiast. He received his Bachelor’s Degree from the University of Western Sydney and his Business Diploma from Georgian College before joining various marketing positions in search portals, e-commerce, higher education, and addiction recovery services.

Follow @ twitter

Related posts

WP Child Themes

WordPress child themes are really simple to make, but I’ve noticed most tutorials are more complicated then they need to be. All you need are two files in a folder: style.css + functions.php Style.css Replace Template: twentyseventeen with the name of your parent theme (it will be the folder name): function.php If you notice the… Read More

Dynamic Page Listings in #WP

Here is how-to dynamically list all children pages associated under a parent page in WordPress. This allows you to change and update pages without updating a sidebar widget/page, and removes the need to create numerous distinct sidebars/sections. To enable this code, add it to your WordPress themes functions.php file, then add the shortcode to the… Read More