Archived topic
Upgraded - lost my logo
15 replies · Started by morriscountynj on May 2, 2016
On this site - http://mcscd.org/
My site logo used to be to the left of the text of the header. When I upgraded,
went away. Was there a change to the parent theme regarding the logo? How can I get the logo back?
Sorry, didn't see how the post rendered. I meant
<div class="site-logo">[[logo]]</div>
went away
This version of GP moved to using the new WordPress 4.5 custom logo (required by WordPress.org).
The migration should have gone well (I tested it thoroughly).
Do you have any custom functions added to the theme?
Ah why didn't I think of that. I actually have a custom header.php on all of the sites, mainly to account for <noscript> navigation. Within the custom header.php is the <?php do_action( 'generate_before_header_content'); ?>, followed by this code:
<?php if ( !empty( $generate_settings['logo'] ) ) : ?>
<div class="site-logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img class="header-image" src="<?php echo $generate_settings['logo']; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>
</div>
<?php endif; ?>
Instead of that code you could just have this now:
generate_construct_logo();
That should fix it :)
This is followed by the title/tagline code.
I made this custom header.php a couple of years ago so it looks like the parent theme version has changed considerably since then...
There's three different functions now for those elements:
// Header widget
generate_construct_header_widget();
// Site title and tagline
generate_construct_site_title();
// Site logo
generate_construct_logo();
Ok, the code now looks like
<?php do_action( 'generate_before_header_content'); ?>
<?php generate_construct_logo(); ?>
and that works :)
Perfect :)
Question about the new functions:
so I can replace
<?php if ( is_active_sidebar('header') ) : ?>
<div class="header-widget">
<?php dynamic_sidebar( 'header' ); ?>
</div>
<?php endif; // end sidebar widget area ?>
with
generate_construct_header_widget();?
It might not work for the way I have the title and tagline setup. I actually switched the location of them (tagline first, then main title, as opposed to vice versa).
That's correct. You can order those 3 functions however you like to have the elements show in different order.
Makes sense.
Are there separate functions for the title and the tagline, or just the lumped-together generate_construct_site_title();?
They're both in that one function.
Makes sense. It looks like this works, just to show you:
<?php generate_construct_logo(); ?>
<?php if ( empty( $generate_settings['hide_title'] ) || empty( $generate_settings['hide_tagline'] ) ) : ?>
<div class="site-branding">
<?php if ( empty( $generate_settings['hide_tagline'] ) ) : ?>
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
<?php endif; ?>
<?php if ( empty( $generate_settings['hide_title'] ) ) : ?>
<h1 class="main-title" itemprop="headline"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
</div>
<?php generate_construct_header_widget(); ?>
Ah you put the tagline above the site title, got it.
That looks good to me :)
