theme customizer - "Display Site Title and Tagline" checkbox without adding Header Image option

admin2025-06-04  1

I'm building theme from scratch. I want to add "Display Site Title and Tagline" checkbox bellow Site Title and Tagline

I can do that If I add the following code to functions.php

add_theme_support( 'custom-header' );

However if I add that code it automatically adds Header Image Option to customizer

How can I add "Display Site Title and Tagline" checkbox without having to display Header Image option in customizer?

What would be proper way of displaying "Display Site Title and Tagline" checkbox without Header Image Options?

I'm building theme from scratch. I want to add "Display Site Title and Tagline" checkbox bellow Site Title and Tagline

I can do that If I add the following code to functions.php

add_theme_support( 'custom-header' );

However if I add that code it automatically adds Header Image Option to customizer

How can I add "Display Site Title and Tagline" checkbox without having to display Header Image option in customizer?

What would be proper way of displaying "Display Site Title and Tagline" checkbox without Header Image Options?

Share Improve this question asked Jan 16, 2019 at 17:25 Dejan GavrilovicDejan Gavrilovic 465 bronze badges 1
  • Related: wordpress.stackexchange/questions/275370/… – Jesse Nickles Commented Oct 27, 2022 at 23:18
Add a comment  | 

1 Answer 1

Reset to default 0

You can do this by removing the control itself using:

function twentynineteen_customize_register( $wp_customize ) {
    $wp_customize->remove_control('header_image');
}
add_action( 'customize_register', 'twentynineteen_customize_register' );

But note that this is not allowed in themes in wordpress as per the WordPress themes handbook guidelines.

If you are submitting the theme in wordpress then you have to add this manually following this documentation https://developer.wordpress/themes/customize-api/customizer-objects/

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748982562a315368.html

最新回复(0)