Tagged: category pages, H1
After using Enfold for over a year, I’m just now realizing that the category pages do not have H1 tags associated with them. I tried to find a theme setting to add them, but was unable. Specifically, I want to add the category name as an H1 to my category pages in order to improve SEO. How can I do this?
Thanks!!
Hi kls1138!`
Thank you for using our theme.
You have to modify enfold\archive.php. Look at line 28-30:
<div class="category-term-description">
<?php echo term_description(); ?>
</div>
When using a child theme copy archive.php from parent theme fiolder into enfold-child folder and modify this file. This will prevent overriding your changes with the next update.
Replace this with:
<?php if( is_category() )
{
echo '<h1>' . single_cat_title('',false) . '</h1>';
}
else
{ ?>
<div class="category-term-description">
<?php echo term_description(); ?>
</div>
<?php
} ?>
Best regards,
Günter
This worked. Thanks, Gunter!!