Browse Source

Handle custom logo.

pull/41/head
Ned Zimmerman 7 years ago
parent
commit
0bd5d538fd
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 19
      header.php
  2. 4
      partials/content-front-page.php

19
header.php

@ -50,16 +50,25 @@
</div> </div>
</div> </div>
<div class="header__brand"> <div class="header__brand">
<h1>
<a class="header__logo" href="<?php echo network_home_url(); ?>"> <a class="header__logo" href="<?php echo network_home_url(); ?>">
<?php if ( has_custom_logo() ) { ?>
<?php $custom_logo_id = get_theme_mod( 'custom_logo' );
printf(
'<img src="%1$s" srcset="%2$s" alt="%3$s" />',
wp_get_attachment_image_src( $custom_logo_id, 'logo' )[0],
wp_get_attachment_image_srcset( $custom_logo_id, 'large' ),
sprintf( __( 'Logo for %s', 'pressbooks-aldine' ), get_bloginfo( 'name', 'display' ) )
); ?>
<?php } else { ?>
<svg class="logo--svg"> <svg class="logo--svg">
<use xlink:href="#logo-pressbooks" /> <use xlink:href="#logo-pressbooks" />
</svg> </svg><?php }
<?php /* <span class="clip"> echo get_bloginfo( 'name', 'display' ); ?>
<?php switch_to_blog( 1 ); echo get_bloginfo( 'name', 'display' ); restore_current_blog(); ?>
</span> */ ?>
</a> </a>
<h1><a href="<?php echo home_url( '/' ); ?>"><?php echo get_bloginfo( 'name', 'display' ); ?></a></h1> </h1>
<p><?php echo get_bloginfo( 'description', 'display' ); ?></p> <p><?php echo get_bloginfo( 'description', 'display' ); ?></p>
</div> </div>
<div class="header__end-container"> <div class="header__end-container">
<nav class="header__nav js-header-nav" id="navigation"> <nav class="header__nav js-header-nav" id="navigation">

4
partials/content-front-page.php

@ -24,7 +24,7 @@ $next_page = $page + 1;
?> ?>
<section class="blocks blocks-<?php echo $block_count; ?> w-100"> <div class="blocks blocks-<?php echo $block_count; ?> w-100">
<?php if ( is_active_sidebar( 'front-page-block' ) ) : <?php if ( is_active_sidebar( 'front-page-block' ) ) :
dynamic_sidebar( 'front-page-block' ); dynamic_sidebar( 'front-page-block' );
else : ?> else : ?>
@ -57,4 +57,4 @@ else : ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
</section> </div>

Loading…
Cancel
Save