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

CSS order

Here is how to load a WordPress child theme’s CSS after the parent theme’s CSS. The trick here is to add a 1 to the add_action script, illustrated below Functions.php Find and edit this little bit of code in the Functions.php file: This way your Parent’s CSS loads first, and your Child theme will load… Read More

Installing Roots Trellis / Bedrock / Sage

Not sure how I feel about Roots.io –> The tutorials seem super easy, but I noticed you can quickly run into issues. What doesn’t help is that I can’t really find any reviews / user tutorials past 2016, the Roots discourse forum appears to be a bubble (not accepting new or differing ideas), and I… Read More