Adding a secondary logo to the header w/links

hey. I want to know how to put a secondary logo next to the site-name on the main header. While I realize this can be done with X-Pro, I’m wondering if there’s a code bit that could make this happen on X.

Usage -

I have a publishing site. There is the main site and multiple Author sub-sites. Each Author’s sub-site is their own name. I want to add the main publishing sites logo to the left of their name on the header, which would link back to the main site while still retaining the ability to go to the homepage of the local sub-site by clicking on the name.

Here’'s an example -

Would like to add our visual logo to the left of the ‘Peter Fae’ name.

(for curiosities sake, this is the main site --> http://www.intothemythica.com)

Hi There,

Please create this directory in your child theme: x-child/framework/legacy/cranium/headers/views/global

After that create the _brand.php file in that directory with the following code:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<?php echo '<h2 class="visually-hidden">' . $site_name . '</h2>'; ?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
  <img src="https://s.w.org/about/images/wordpress-logo-notext-bg.png" />
</a>

Hope it helps :slight_smile:

Mmm … it did. However, I’d like the logo on the LEFT instead of the right and want it to click back to :slight_smile:

how is do?

:slight_smile:

also, it’s squeezing out the menu. is there a way to correct that? Should I make the icon smaller?

Hi There,

This is your logo code right?

<img src="http://peterfae.intothemythica.com/wp-content/uploads/sites/250/2018/01/Mythica-logo-white-75x69.png">

Please bring that just below the line:

<?php echo '<h2 class="visually-hidden">' . $site_name . '</h2>'; ?>

And update that code to this, so it can be linked back to http://www.intothemythica.com

<a href="http://www.intothemythica.com" class="secondary-logo left">
<img src="http://peterfae.intothemythica.com/wp-content/uploads/sites/250/2018/01/Mythica-logo-white-75x69.png">
</a>

Hope it helps,
Cheers!

So … so good.

One last bit. How to make the logo drop a little bit so it feels more aligned with text?
like, it’s aligned with the bottom of the text, I’d like it to go a bit lower so it’s more aligned with … if you imagined a centerline through the text, visually. that make sense? like a little bit lower.

Hi again,

Please add the following code in your Customizer via Appearance > Customize > Custom > Edit Global CSS:

.secondary-logo {
    margin-top: 3px;
}

Adjust the margin as per your need. Let us know how this goes!

how do I add that to the child theme so it applies across all the sub-sites?

Hi There,

Navigate to Appearance > Editor select the x -child from the dropdown (upper-right) and select the Stylesheet (style.css file) to be edited.


Note: do not edit the functions.php file in this area, if you get an (even the smallest) syntax error on that file your site will be down.

Hope it helps,
Cheers!

So … adjusting that on the site level (as compared to FTP) affects ALL instances of the child theme throughout the multisite?

Hi there,

As long as multiple sites use the same child theme, then yes, any child will take effect on all sites. FTP or through Admin.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.