- This topic has 46 replies, 3 voices, and was last updated 3 years, 10 months ago by Leo.
-
AuthorPosts
-
May 22, 2020 at 1:40 pm #1297233Joe
Followed the video instructions to activate the Disable Elements and Elements. Gone into pages but the field with the options are not in here as in video.
May 22, 2020 at 3:00 pm #1297285JoeStrange why I’m not seeing this. Just went through looking for this again.
May 22, 2020 at 10:28 pm #1297511LeoStaffCustomer SupportIt should definitely be there.
Are you using the Gutenberg editor?
If so it would be on the right hand side.
Let me know 🙂
May 23, 2020 at 12:58 am #1297615JoeChanged over to Gutenberg and found it on the right hand side as you mention. Ticked the Content Title box which has stripped out the h1 tags. Is this what you are looking for.
May 23, 2020 at 5:00 am #1297879JoeDoing this has not put site title in h1 tags. All it has done is removed the tags. Surely this is no answer.
May 23, 2020 at 5:07 am #1297891DavidStaffCustomer SupportIf i understand correctly in place of the Content Title ie. Home you want it to display the Site Title.
If that is the case then remove the Content Title using the Disable ElementsThen edit your Page in Elementor and add in your own H1 Heading and write in your Site title.
May 23, 2020 at 5:11 am #1297895JoeAs stated, I want the theme to show my site title in h1 tags on the home page.
May 23, 2020 at 5:31 am #1297937JoeAs I was requested to do above, I have already removed Content Title using the Disable Elements. But was awaiting the next stage. So does Generate Press theme not automaticaly have h1 tags?
May 23, 2020 at 5:40 am #1297943DavidStaffCustomer SupportThe Site Title will switch to H1 on the front page IF it is set to display the Latest Posts.
For a static home page you will need to add this PHP Snippet:add_filter( 'generate_site_title_output', function( $output ) { return sprintf( '<%1$s class="main-title" itemprop="headline"> <a href="%2$s" rel="home"> %3$s </a> </%1$s>', ( is_front_page() ) ? 'h1' : 'p', esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ), get_bloginfo( 'name' ) ); });
May 23, 2020 at 5:43 am #1297949JoeUsing static home page. Could you please show me where abouts to add the code you provided?
May 23, 2020 at 5:48 am #1297956DavidStaffCustomer Supportoop sorry – for sure – this article explains:
https://docs.generatepress.com/article/adding-php/
TLDR: If your using a Child Theme it goes in your funtions.php. If not use the Code Snippets plugin: https://en-gb.wordpress.org/plugins/code-snippets/ to add this code.
May 23, 2020 at 5:58 am #1297964JoeI an using a Child Theme so will add it to the funtions.php. Can you point to where in the code to add the extra part?
<?php
/**
* GeneratePress child theme functions and definitions.
*
* Add your custom PHP in this file.
* Only edit this file if you have direct access to it on your server (to fix errors if they happen).
*/function generatepress_child_enqueue_scripts() {
if ( is_rtl() ) {
wp_enqueue_style( ‘generatepress-rtl’, trailingslashit( get_template_directory_uri() ) . ‘rtl.css’ );
}
}
add_action( ‘wp_enqueue_scripts’, ‘generatepress_child_enqueue_scripts’, 100 );May 23, 2020 at 8:36 am #1298212JoeI am really surprised that this theme does not have this feature already built in. As far a I was aware using the H1 tag for a post or page’s title was the best option regarding the SEO of a site. So the question is. Is this a problem with my site only or are all other sites using Generate Press built the same way and have to add extra code in order to have this feature?
May 23, 2020 at 9:58 am #1298288LeoStaffCustomer SupportSorry I’m a bit confused and I think there is a bit of miscommunication here.
As far a I was aware using the H1 tag for a post or page’s title was the best option regarding the SEO of a site.
That’s exactly what GP does.
May 23, 2020 at 10:09 am #1298299JoeIf that is so then why do I have to do the following? I am waiting for a reply about where to add this code into the funtions.php. The Site Title will switch to H1 on the front page IF it is set to display the Latest Posts.
For a static home page you will need to add this PHP Snippet:add_filter( ‘generate_site_title_output’, function( $output ) {
return sprintf(
‘<%1$s class=”main-title” itemprop=”headline”>
%3$s
</%1$s>’,
( is_front_page() ) ? ‘h1’ : ‘p’,
esc_url( apply_filters( ‘generate_site_title_href’, home_url( ‘/’ ) ) ),
get_bloginfo( ‘name’ )
);
}); -
AuthorPosts
- You must be logged in to reply to this topic.