Archived topic
Change Site Logo Link in Element Header
3 replies · Started by DAVID on September 18, 2018
hi - I'm setting up a sort of sub site within a site. The sub-site uses a different logo and menu on its four pages. I'm using conditional menu to replace the navigation so that you can only navigate within the four pages of the sub-site and also replacing the site header using the new element add-on. I have changed the site logo using the element add-on and applied it to the four pages. All looks good.... but the site link on the site logo is the same as the overall theme set in customiser and I'd like it to be something else.
Is this possible? Or can I request a feature that when setting a new site header logo in the Element add-on, that you can also amend the link.
In the meantime is anyone able to figure out how I can override the site link on these sub-pages?
Thanks.
Hi there,
You can use the generate_logo_href filter.
You should see lots of examples if you search the keyword in this forum.
This isn't very commonly asked so I don't think it will make it to the feature. We will definitely consider it if more requests come up.
Let me know if this helps :)
Thanks Leo.
All working. Put the pages into a category and used this code:
add_filter( 'generate_logo_href','generate_add_custom_logo_href' );
function generate_add_custom_logo_href()
{
if ( in_category( 'services' ) ) {
return 'http://domain.com/services/';
}
return 'http://domain.com/';
}
No problem :)