[Resolved] How do I change the Blog Title Link

Home Forums Support [Resolved] How do I change the Blog Title Link

Home Forums Support How do I change the Blog Title Link

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #150218
    Deyana

    Hi,

    I want to change my blog title link to another – different from home url. I read different advice on the internet for header.php, but they are not applicable to GeneratePress theme. Would you help me with this?

    Thanks in advance.

    #150222
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can change your site title URL with a simple filter function.

    add_filter( 'generate_logo_href','generate_custom_logo_href' );
    function generate_custom_logo_href()
    {
    	// Enter the URL you want your logo to link to below
    	return 'http://YOURURLHERE.com';
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    #150269
    Deyana

    Thanks, but it isn’t work. I use text title, not image.

    I tried this code: https://gist.github.com/generatepress/d58dd082dbd741943aee

    I changed only

    a href=”<?php echo esc_url( home_url( ‘/’ ) ); ?

    and its work and it is exactly what I wanted, but I have to insert all code from the link above.

    #150275
    Tom
    Lead Developer
    Lead Developer

    Thanks for bringing this to my attention – I’ve added a filter to the site title link as well which will appear in the next version.

    I updated the code you linked to with the new code with the filter. Once the new version is out, you’ll be able to use this:

    add_filter( 'generate_site_title_href','generate_custom_site_title_href' );
    function generate_custom_site_title_href()
    {
    	// Enter the URL you want your logo to link to below
    	return 'http://YOURURLHERE.com';
    }
    #230657
    Joseph

    Thanks Tom, worked like a champ!!

    #230677
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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