- This topic has 8 replies, 2 voices, and was last updated 5 months, 1 week ago by
David.
-
AuthorPosts
-
October 14, 2022 at 7:58 am #2373609
Rekamedia
Hi,
Why my website site title is showing the site title in <p> tag?
Normally site title will shown as H1. This is currently is shown in my website:<p class="main-title" itemprop="headline"><a href="https://google.com/" rel="home">Site Title</a></p>
October 14, 2022 at 8:22 am #2373632David
StaffCustomer SupportHi there,
by default the Theme outputs the site title as follows:
1. Homepage set to Display latests posts only uses:
<h1>
.
As this page does not have a H1 Content title by default.2. All other pages it displays the site title as a
<p>
As other pages by default have a H1 Content titleSo do you want every page to have the site title as a H1 ? As that may lead to multiple H1s on pages and posts.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 14, 2022 at 8:24 am #2373634Rekamedia
Hi,
Let me try create a heading in the page with H1 tag.
(Update): I created a heading H1 with the main keyword. So now the site title is still showing in <p>, and the homepage has one H1 with the main keyword. Is this normal?
Usually on other theme, the site title is always in H1.
October 14, 2022 at 8:31 am #2373652David
StaffCustomer SupportAs i said above the only time we output the Site Title as a H1 is on a Homepage that is set to display the latest posts.
As this is the only page that does not have a H1 Content Title.On every other Page, Post, Archive the Content Title gets output as a H1, so you do not want the Site Title to be a H1 there.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 14, 2022 at 8:35 am #2373659Rekamedia
But, my homepage is not showing latest post, this is my use case, it’s a sales page. How to change this?
I want the site title to be always in H1, so I can use other heading to other keywords.October 14, 2022 at 8:50 am #2373692Rekamedia
Any code that I can use to fix this?
October 14, 2022 at 8:58 am #2373700David
StaffCustomer SupportYou can add this PHP Snippet and it will change the Site Title to
H1
on every page:add_filter( 'generate_site_title_output', function( $output ) { return sprintf( '<h1 class="main-title"%3$s> <a href="%2$s" rel="home"> %2$s </a> </h1>', esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ), get_bloginfo( 'name' ), 'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : '' ); });
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 14, 2022 at 4:54 pm #2374002Rekamedia
It says synxtax error?
Update: It’s ok, missing a ;
October 15, 2022 at 3:30 am #2374219David
StaffCustomer SupportSorry about that, correct the code above.
Glad to hear you got it working
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.