Site logo

Archived topic

How do I change the Blog Title Link

5 replies · Started by Deyana on November 3, 2015

Viewing posts 1–6 of 6

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.

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/

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.

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';
}

Thanks Tom, worked like a champ!!

You're welcome :)

This archived topic is closed to new replies.