Created
November 9, 2015 07:15
-
-
Save generatepress/eca14d26e64d77d07384 to your computer and use it in GitHub Desktop.
Move the header widget below the site title/description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'generate_header_items' ) ) : | |
/** | |
* Build the header | |
* | |
* Wrapping this into a function allows us to customize the order in a child theme | |
* | |
* @since 1.2.9.7 | |
*/ | |
function generate_header_items() | |
{ | |
$generate_settings = wp_parse_args( | |
get_option( 'generate_settings', array() ), | |
generate_get_defaults() | |
); | |
// Get the title and tagline | |
$title = get_bloginfo( 'title' ); | |
$tagline = get_bloginfo( 'description' ); | |
// If the disable title checkbox is checked, or the title field is empty, return true | |
$disable_title = ( '1' == $generate_settings[ 'hide_title' ] || '' == $title ) ? true : false; | |
// If the disable tagline checkbox is checked, or the tagline field is empty, return true | |
$disable_tagline = ( '1' == $generate_settings[ 'hide_tagline' ] || '' == $tagline ) ? true : false; | |
// Site title and tagline | |
if ( false == $disable_title || false == $disable_tagline ) : ?> | |
<div class="site-branding"> | |
<?php if ( false == $disable_title ) : ?> | |
<p class="main-title" itemprop="headline"><a href="<?php echo apply_filters( 'generate_site_title_href', esc_url( home_url( '/' ) ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> | |
<?php endif; | |
if ( false == $disable_tagline ) : ?> | |
<p class="site-description"><?php echo html_entity_decode( bloginfo( 'description' ) ); ?></p> | |
<?php endif; ?> | |
</div> | |
<?php endif; | |
// Site logo | |
if ( ! empty( $generate_settings['logo'] ) ) : ?> | |
<div class="site-logo"> | |
<a href="<?php echo apply_filters( 'generate_logo_href' , esc_url( home_url( '/' ) ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img class="header-image" src="<?php echo esc_url( $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; | |
// Header widget | |
if ( is_active_sidebar('header') ) : ?> | |
<div class="header-widget"> | |
<?php dynamic_sidebar( 'header' ); ?> | |
</div> | |
<?php endif; | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment