2

Am making a custom theme, and in the Theme Customizer, will it be possible to change that checkbox under Site Title to something like "Display Site Title instead of Logo"?

(i have removed that tagline field and added an image upload field for Logo)

or, remove that checkbox from there? which one is easier?

thanks!

2
  • okay, i decided to remove that checkbox, used $wp_customize->remove_control('display_header_text'); thanks to wordpress.stackexchange.com/a/62871/92351 Commented Apr 14, 2016 at 7:46
  • 1
    please, if you have a solution while the question itself is not a duplicate, just post it as an answer and accept it Commented Apr 14, 2016 at 8:04

2 Answers 2

0

You will need to de-register that control. It will look like this:

/**
 * Remove parts of the Options menu we don't use.
 *
 * @param WP_Customize_Manager $wp_customize Customizer manager.
 */
function de_register( $wp_customize ) {
    $wp_customize->remove_control('display_header_text');
}
add_action( 'customize_register', 'de_register', 11 );

For more information, this Theme Customization is a good start.

0

@flummox's answer is on point; existing settings can be removed, moved and altered. Expanding upon Flummox's example.

/**
     * Modify existing / default customizer settings.
     *
     * @param WP_Customize_Manager $wp_customize Customizer manager.
     */


    function my_update_header_text( $wp_customize ) {
                // remove
                $wp_customize -> remove_section('display_header_text');
                // move <-- must remove control first to move the control
                $wp_customize -> get_control('display_header_text') -> section = 'my_theme_options[header]';
                // change label/description
                $wp_customize -> get_control('display_header_text') -> label = __('Display Header Text');
                // change display order
                $wp_customize -> get_control('display_header_text') -> priority = 10;  
  }
    add_action( 'customize_register', 'my_update_header_text', 11 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.