Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
Created July 18, 2014 06:46
Show Gist options
  • Save bryanwillis/46778416451f4898b4f7 to your computer and use it in GitHub Desktop.
Save bryanwillis/46778416451f4898b4f7 to your computer and use it in GitHub Desktop.
<?php
// ADD THIS TO YOUR CHILD THEMES FUNCTIONS.PHP
remove_action( 'genesis_site_title', 'genesis_remove_site_title' );
add_action( 'genesis_site_title', 'child_genesis_add_site_title' );
function child_genesis_add_site_title() {
?>
<?php if ( get_theme_mod( 'child_genesis_logo' ) ) : ?>
<h1 itemprop="headline" class='site-title'><a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'><img src='<?php echo esc_url( get_theme_mod( 'child_genesis_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'></a></h1>
<?php else : ?>
<h1 itemprop="headline" class='site-title'><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; ?>
<?php
}
function child_genesis_theme_customizer_add_logo_uploader( $wp_customize ) {
$wp_customize->add_setting( 'child_genesis_logo' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'child_genesis_logo', array(
'label' => 'Logo Image',
'section' => 'child_genesis_logo_section',
'settings' => 'child_genesis_logo',
) ) );
}
add_action('customize_register', 'child_genesis_theme_customizer_add_logo_uploader');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment