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

Full size thumbnail image w/ alt tag title

Here is a quick example of how to add a large thumbnail image with the title as the Alt Tag attribute Alt Tag attribute <?php the_post_thumbnail( ‘large’, array( ‘title’ => get_the_title() ) ); ?> You can replace ‘large’ with thumbnail, medium, medium_large, & full.

Call Tracking using GTM

I’ve noticed onClick tracking can be troublesome and sometimes doesn’t work as expected on WordPress websites, so its never 100% accurate. To get around these errors, I use Google Tag Manager to track call events. How to Track phone calls using Google Tag Manager: 1. If you haven’t already, install GTM on your website. 2…. Read More