- This topic has 15 replies, 2 voices, and was last updated 8 years ago by morriscountynj.
-
AuthorPosts
-
May 2, 2016 at 5:50 am #191006morriscountynj
On this site – http://mcscd.org/
My site logo used to be to the left of the text of the header. When I upgraded,
[[logo]]went away. Was there a change to the parent theme regarding the logo? How can I get the logo back?
May 2, 2016 at 6:02 am #191009morriscountynjSorry, didn’t see how the post rendered. I meant
<div class="site-logo">[[logo]]</div>
went away
May 2, 2016 at 8:24 am #191061TomLead DeveloperLead DeveloperThis 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?
May 2, 2016 at 8:43 am #191070morriscountynjAh 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; ?>
May 2, 2016 at 8:49 am #191071TomLead DeveloperLead DeveloperInstead of that code you could just have this now:
generate_construct_logo();
That should fix it π
May 2, 2016 at 8:53 am #191072morriscountynjThis 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…
May 2, 2016 at 8:54 am #191073TomLead DeveloperLead DeveloperThere’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();
May 2, 2016 at 9:05 am #191077morriscountynjOk, the code now looks like
<?php do_action( 'generate_before_header_content'); ?> <?php generate_construct_logo(); ?>
and that works π
May 2, 2016 at 9:06 am #191078TomLead DeveloperLead DeveloperPerfect π
May 2, 2016 at 9:09 am #191079morriscountynjQuestion 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).
May 2, 2016 at 9:10 am #191080TomLead DeveloperLead DeveloperThat’s correct. You can order those 3 functions however you like to have the elements show in different order.
May 2, 2016 at 9:11 am #191081morriscountynjMakes sense.
Are there separate functions for the title and the tagline, or just the lumped-together
generate_construct_site_title();
?May 2, 2016 at 9:13 am #191082TomLead DeveloperLead DeveloperThey’re both in that one function.
May 2, 2016 at 9:15 am #191084morriscountynjMakes 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(); ?>
May 2, 2016 at 9:16 am #191086TomLead DeveloperLead DeveloperAh you put the tagline above the site title, got it.
That looks good to me π
-
AuthorPosts
- You must be logged in to reply to this topic.