I have sort of a special use case and need to remove the link in the main logo that is in the header. I know it can be done because I did this once before on another test project a few years back but I cannot remember how I did it. Thank you for any assistance.
Hi Patrick,
Thank you for reaching out to us. Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when a theme update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then create a new file _brand.php and paste the following code inside:
<?php
// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================
$option_logo_text = x_get_option( 'x_logo_text' );
$option_logo_src = x_get_option( 'x_logo' );
$logo_text = ( empty( $option_logo_text ) ) ? get_bloginfo( 'name' ) : $option_logo_text;
if ( empty( $option_logo_src ) ) {
$logo_output = $logo_text;
} else {
$logo_src = x_make_protocol_relative( $option_logo_src );
$logo_output = '<img src="' . $logo_src . '" alt="' . $logo_text . '">';
}
if ( x_get_option( 'x_logo_visually_hidden_h1' ) ) {
echo '<h1 class="visually-hidden">' . $logo_text . '</h1>';
}
?>
<a href="javascript:void(0);" class="<?php x_brand_class(); ?>">
<?php echo $logo_output; ?>
</a>
Now save the file and upload it to /x-child/framework/legacy/cranium/headers/views/global directory using FTP. If you don’t find folders in your child theme then create them to match the exact path /x-child/framework/legacy/cranium/headers/views/global
Please note that X header is designed with ready to go basic settings so we often receive header related customization questions or requests and this was the reason why a header and footer builder was created and an advanced X version was formed now called Pro . Please consider upgrading to Pro so you can build a custom header yourself without custom coding. In case you upgrade to Pro and you get stuck with the options, we’re here to assist all the way.
You can also checkout https://theme.co/docs/converting-from-x-to-pro and https://theme.co/docs/the-difference-between-x-pro
Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.
Hope this helps!
I do have a pro license and it was super simple to accomplish what I wanted using the Pro Header Builder. Thank you for your suggestion Nabeel.
Glad to hear that, Paddy!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
