Can I add to the Customizer?

I’m trying to add settings to the customizer through the child theme. For example a text input to the header logo section so customers can add text next to their logo. Overriding the header layout templates is easy enough, but having a hard time getting access to the customizer through the child theme.

thanks!

  • Bill

Hey Bill,

You can check out this thread as the guy was trying the same thing as you. Let us know how it goes and/or if you need anything further. :slight_smile:

Ben

Thanks Ben! I’ll get back to you if I have any further questions…

Hey Ben, thanks for the thread link that was very helpful! Another question though…

is there a way to hook into the Beaver Class Builders or is that completely cut off?
in this case, I’d much rather just add the logo text option to the image logo type and use the FLTheme::logo(); function to render than rewriting that.

…or is there a way to access certain parts of the customizer and render specific parts?

like just pull the logo image and logo text into a nav template?

Hey Mark,

Unfortunately, you won’t be able to modify the classes via child theme. You can get more information about add a setting under the theme customizer by checking the link below.

https://codex.wordpress.org/Theme_Customization_API

I’m just going to explain what Tom did on that thread as it was a bit hard to understand. First, modify the nav-*.php files(depending on which you want, bottom, right, center) to include your text by placing the code <div class=”fl-desc”><?php echo FLTheme::get_setting( ‘fl-logo-description’ ); ?> </div> wherever you see fit. Then, add the setting into the customizer using this code.

function header_slogan_setting($wp_customize) {
	$wp_customize->add_setting(
		‘fl-logo-description’, array(
			‘default’ => get_bloginfo(‘description’),
			‘transport’ => ‘postMessage’
		)
	);
	
	$wp_customize->add_control(
		‘fl-logo-description’, array(
			‘section’ => ‘fl-header-logo’,
			‘label’ => ‘Site Slogan’,
			‘type’ => ‘text’,
			‘settings’ => ‘fl-logo-description’
		)
	);
}
add_action( ‘customize_register’, ‘header_slogan_setting’);

Hope this makes sense!

Ben