- This topic has 15 replies, 3 voices, and was last updated 2 years, 1 month ago by Leo.
June 2, 2019 at 10:08 am #917882Giuseppe
When I create an post and write its own H1, if I go to the blog’s home page, the H1 written is turned into H2 on the blog’s homepage. Why?
Even the titles of the posts, present in the category page, are transformed into H2.
Is it possible to transform the H2 of the post, present on the blog home page and in category page in H3?
In this way, I avoid the counting of H2 duplicates by the crawlers.
ThanksJune 2, 2019 at 1:12 pm #917980LeoStaffCustomer Support
It is do-able but I don’t believe it is a good idea to change from entry titles from h2 to h3.
Let me know what you think.June 3, 2019 at 7:03 am #918584Giuseppe
I read David’s motivations for not changing the H2 in H3.
But there is a seo problem, the duplication of H2.
In this way, in fact, an H2 is created on the blog home page and another identical H2 is created on the category page to which the article belongs.
For this I would like to change the H2 to H3 or keep H2 on the blog home page while on the article category page, turn H2 into H3.
ThanksJune 3, 2019 at 9:17 am #918722LeoStaffCustomer Support
That case you would have to overwrite the
You can copy that file into your child theme folder and make the changes there.June 3, 2019 at 9:29 pm #919097Giuseppe
the linked file already contains the change to transform the H2 into H3 or what do I have to change inside the file to get this result?
ThanksJune 4, 2019 at 2:34 am #919279DavidStaffCustomer Support
the line hightlighted here needs to be updated:
You can see the
</h2>tags that need to be changed.June 7, 2019 at 9:50 pm #923089Giuseppe
could you explain to me how do I access the content.php file and how can I change it?
ThanksJune 7, 2019 at 9:58 pm #923090LeoStaffCustomer Support
content.phpfile would be directly in the theme’s folder (wp-content > themes > generatepress).
You can download a theme’s file here, or directly from the link.
You would need to copy the file, paste it into your child theme, then make the change to line 34 of the file as David suggested.June 8, 2019 at 5:17 am #923254Giuseppe
I changed line 34 of the file as David explained in this way :
the_title( sprintf( '<h3 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
I saved the file and uploaded it to the childtheme folder (by FTP), but does’t works, because the titles of posts on the blog home page and in the category pages continue to be H2.June 8, 2019 at 7:40 am #923421LeoStaffCustomer SupportJune 8, 2019 at 8:06 am #923436Giuseppe
in private there is link of blog home page where the post titles are still in H2 despite the change.
Also in the category page they continue to be in H2
ThanksJune 8, 2019 at 8:10 am #923439LeoStaffCustomer SupportJune 8, 2019 at 8:15 am #923441Giuseppe
the child theme actually is activated under Appearance > Themes.
I downloaded a completely blank starter child theme from hereJune 8, 2019 at 9:44 am #923493LeoStaffCustomer Support
Hmm any caching issue?
I just tried the exactly same thing and it worked without any issues:
Make sure the
content.phpfile is directly under the
You should also see
function.phpat the same level.June 8, 2019 at 10:49 am #923538Giuseppe
I tried the procedure again, now it works!
Thanks a lot
- You must be logged in to reply to this topic.