Created
June 12, 2017 14:45
-
-
Save congthien/36e01dd6f4ffdae87870eb6ce4dc8cbf to your computer and use it in GitHub Desktop.
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
function onepress_site_logo(){ | |
$classes = array(); | |
$html = '' ; | |
$classes['logo'] = 'no-logo-img'; | |
if ( function_exists( 'has_custom_logo' ) ) { | |
if ( has_custom_logo()) { | |
$classes['logo'] = 'has-logo-img'; | |
$html .= '<div class="site-logo-div">'; | |
$html .= get_custom_logo(); | |
$html .= '</div>'; | |
} | |
} | |
$hide_sitetile = get_theme_mod( 'onepress_hide_sitetitle', 0 ); | |
$hide_tagline = get_theme_mod( 'onepress_hide_tagline', 0 ); | |
if ( ! $hide_sitetile ) { | |
$classes['title'] = 'has-title'; | |
if ( is_front_page() && !is_home() ) { | |
$html .= '<h1 class="site-title"><a target="_blank" class="site-text-logo" href="' . esc_url(home_url('/')) . '" rel="home">' . get_bloginfo('name') . '</a></h1>'; | |
} else { | |
$site_url = ( is_page(1325) ) : 'your-link-here' : esc_url(home_url('/')) ; | |
$html .= '<p class="site-title"><a target="_blank" class="site-text-logo" href="' . $site_url . '" rel="home">' . get_bloginfo('name') . '</a></p>'; | |
} | |
} | |
if ( ! $hide_tagline ) { | |
$description = get_bloginfo( 'description', 'display' ); | |
if ( $description || is_customize_preview() ) { | |
$classes['desc'] = 'has-desc'; | |
$html .= '<p class="site-description">'.$description.'</p>'; | |
} | |
} else { | |
$classes['desc'] = 'no-desc'; | |
} | |
echo '<div class="site-brand-inner '.esc_attr( join( ' ', $classes ) ).'">'.$html.'</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment