Skip to content

Instantly share code, notes, and snippets.

@anwerashif
Created November 3, 2017 19:19
Show Gist options
  • Save anwerashif/bcbd95e290ada86394f4e82ae002a1d6 to your computer and use it in GitHub Desktop.
Save anwerashif/bcbd95e290ada86394f4e82ae002a1d6 to your computer and use it in GitHub Desktop.
Add Custom Logo to Genesis Child Theme
<?php
// Do NOT add the opening PHP tag
// Add custom logo or Enable option in Customizer > Site Identity
add_theme_support( 'custom-logo', array(
'width' => 244,
'height' => 315,
'flex-width' => true,
'flex-height' => true,
'header-text' => array( '.site-title', '.site-description' ),
) );
// Display custom logo
add_action( 'genesis_site_title', 'the_custom_logo', 0 );
/* Remove title/logo metabox from Genesis theme options page
* See http://www.billerickson.net/code/remove-metaboxes-from-genesis-theme-settings/
* Updated to use $_genesis_admin_settings instead of legacy variable in Bill's example.
*/
add_action( 'genesis_theme_settings_metaboxes', 'be_remove_metaboxes' );
function be_remove_metaboxes( $_genesis_admin_settings ) {
remove_meta_box( 'genesis-theme-settings-header', $_genesis_admin_settings, 'main' );
}
/*
* Remove title/logo metabox from Genesis customizer
* See https://developer.wordpress.org/themes/advanced-topics/customizer-api/
*/
add_action( 'customize_register', 'es_theme_customize_register', 99 ); // Priority had to be last for this to work
function es_theme_customize_register( $wp_customize ) {
$wp_customize->remove_control('blog_title');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment