- This topic has 15 replies, 3 voices, and was last updated 4 years ago by
Leo.
-
AuthorPosts
-
June 2, 2019 at 10:08 am #917882
Giuseppe
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.
Thanks
June 2, 2019 at 1:12 pm #917980Leo
StaffCustomer SupportHi there,
It is do-able but I don’t believe it is a good idea to change from entry titles from h2 to h3.
David explained here: https://generatepress.com/forums/topic/changing-the-h2-header-to-h3-and-the-distance-between-the-featured-image/
Let me know what you think.
June 3, 2019 at 7:03 am #918584Giuseppe
Hi Leo
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.
Thanks
June 3, 2019 at 9:17 am #918722Leo
StaffCustomer SupportThat case you would have to overwrite the
content.php
file:
https://github.com/tomusborne/generatepress/blob/master/content.phpYou can copy that file into your child theme folder and make the changes there.
June 3, 2019 at 9:29 pm #919097Giuseppe
Hi Leo
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?
Thanks
June 4, 2019 at 2:34 am #919279David
StaffCustomer SupportHi there,
the line hightlighted here needs to be updated:
You can see the
<h2>
and</h2>
tags that need to be changed.June 7, 2019 at 9:50 pm #923089Giuseppe
Hi David,
could you explain to me how do I access the content.php file and how can I change it?
Thanks
June 7, 2019 at 9:58 pm #923090Leo
StaffCustomer SupportThe
content.php
file 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
Hi Leo
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 #923421Leo
StaffCustomer SupportCan you link us to the page in question?
June 8, 2019 at 8:06 am #923436Giuseppe
Hi Leo
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
Thanks
June 8, 2019 at 8:10 am #923439Leo
StaffCustomer SupportIs the child theme actually activated under Appearance > Themes?
June 8, 2019 at 8:15 am #923441Giuseppe
Yes Leo,
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 #923493Leo
StaffCustomer SupportHmm any caching issue?
I just tried the exactly same thing and it worked without any issues:
https://www.screencast.com/t/XLxsbH5kMake sure the
content.php
file is directly under thegeneratepress_child
folder.You should also see
style.css
andfunction.php
at the same level.June 8, 2019 at 10:49 am #923538Giuseppe
Hi Leo,
I tried the procedure again, now it works!
Perfect!
Thanks a lot
-
AuthorPosts
- You must be logged in to reply to this topic.