Tagged: category pages, H1
My category pages do not have any H1 on them and it’s causing warnings within SEMRush.
I have seen the threads here
https://kriesi.at/support/topic/add-h1-tag-to-category-pages/#post-413960
but it appears the line numbers are different in the current archive.php
-is there an update on the lines of code which need to be updated?
-is the revised code listed in the link above still valid?
Thank you in advance!
Hey tsays,
Thank you for the inquiry.
You have to edit the same file (archive.php) and look for the same lines of code starting from line 38.
$tds = term_description();
if( $tds )
{
echo "<div class='category-term-description'>{$tds}</div>";
}
Replace it with:
if( is_category() )
{
echo '<h1>' . single_cat_title('',false) . '</h1>';
}
else
{
echo "<div class='category-term-description'>{$tds}</div>";
}
Best regards,
Ismael
Thank you for your help. I appreciate it.
Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike