Home › Forums › Basel support forum › Changing the URL the header logo points to
Changing the URL the header logo points to
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by Artem Temos.
-
AuthorPosts
-
December 21, 2016 at 2:18 am #8152
raulParticipantBasel is deployed on a site inside my subdomain-based multisite WP. I want the header logo to link to the parent domain rather than the subdomain it is deployed on, e.g. I want it to link to mydomain.com rather than shop.mydomain.com.
How can I achieve this? I don’t want to override core PHP files in my child theme, which are bound to change between releases.
Nor do I want a JS solution, as it won’t play well with the link analysis done by Google and crawlers.
Thanks.
December 21, 2016 at 9:27 am #8159
Artem TemosKeymasterHello,
The only one way is to do this is to override logo function in the child theme functions.php file. You can’t do this in any other way. You can put this code to your child theme
function basel_header_block_logo() { $header_color_scheme = basel_get_opt( 'header_color_scheme' ); // Get the logo $logo = BASEL_IMAGES . '/logo.png'; $logo_white = BASEL_IMAGES . '/logo-white.png'; $logo_uploaded = basel_get_opt('logo'); $logo_white_uploaded = basel_get_opt('logo-white'); if(isset($logo_white_uploaded['url']) && $logo_white_uploaded['url'] != '') { $logo_white = $logo_white_uploaded['url']; } if(isset($logo_uploaded['url']) && $logo_uploaded['url'] != '') { $logo = $logo_uploaded['url']; } if( $header_color_scheme == 'light' ) { $logo = $logo_white; } $protocol = basel_http() . "://"; $logo = $protocol. str_replace(array('http://', 'https://'), '', $logo); $logo_img = '<img src="' . $logo . '" alt="' . get_bloginfo( 'name' ) . '" />' ?> <div class="site-logo"> <a href="HTTP://YOUR_URL.COM" rel="home"> <?php echo ( $logo_img ); ?> </a> </div> <?php }
Regards
December 21, 2016 at 11:17 am #8163
raulParticipantThanks. You have built a quality theme, clearly with extensibility in mind!
The
function_exists
check in the parent theme is what made overriding the function possible in the child theme.I come from using Jupiter, and oh man. Doing anything with that theme is a major pain in the *ss.
Cheers!
December 21, 2016 at 2:56 pm #8170
Artem TemosKeymasterWe are glad that our customizability features are good for you. Hope you will build an awesome website with Basel. Anyway, we would be glad to hear any additional advice or feature requests from you to make it even better.
Thank you in advance!
-
AuthorPosts
- You must be logged in to create new topics. Login / Register