Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Remove Site Title link

  • Hi Guys,

    I’m using GeneratePress Premium with the GP Child theme.

    In Appearance > Customize > Site Identity I have enabled a logo along with the Site Title. By default, when the Site Title is enabled, it becomes a link to the Home page.

    Is there any way to remove the link and just have a plain <p> Site Title?

    Thanks.

    WordPress 6.9.1
    GeneratePress Premium 2.5.5
    GenerateBlocks Pro 2.5.0

  • Hi there,

    Yes, you can use this snippet:

    add_filter( 'generate_site_title_output', function( $output ) {
        $tag = ( is_front_page() && is_home() ) ? 'h1' : 'p';
        $schema_attr = 'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : '';
    
        return sprintf(
            '<%1$s class="main-title"%3$s>%2$s</%1$s>',
            $tag,
            get_bloginfo( 'name' ),
            $schema_attr
        );
    });

    Adding PHP: https://docs.generatepress.com/article/adding-php/

  • Perfect. Thank you Alvind.

  • You’re welcome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.