Extract newsletter into reusable template part and add Customizer support
This commit is contained in:
@@ -114,6 +114,45 @@ function wisdom1_customize_register($wp_customize)
|
||||
'section' => 'wisdom1_hero_section',
|
||||
'settings' => 'hero_background_image',
|
||||
)));
|
||||
|
||||
// Add Newsletter Section
|
||||
$wp_customize->add_section('wisdom1_newsletter_section', array(
|
||||
'title' => __('Newsletter Section', 'wisdom1'),
|
||||
'priority' => 35,
|
||||
));
|
||||
|
||||
// Newsletter Headline
|
||||
$wp_customize->add_setting('newsletter_headline', array(
|
||||
'default' => 'Receive weekly insights directly in your inbox.',
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
));
|
||||
$wp_customize->add_control('newsletter_headline', array(
|
||||
'label' => __('Headline', 'wisdom1'),
|
||||
'section' => 'wisdom1_newsletter_section',
|
||||
'type' => 'text',
|
||||
));
|
||||
|
||||
// Newsletter Subheadline
|
||||
$wp_customize->add_setting('newsletter_subheadline', array(
|
||||
'default' => 'Join our community and get our latest thoughts sent straight to you.',
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
));
|
||||
$wp_customize->add_control('newsletter_subheadline', array(
|
||||
'label' => __('Subheadline', 'wisdom1'),
|
||||
'section' => 'wisdom1_newsletter_section',
|
||||
'type' => 'textarea',
|
||||
));
|
||||
|
||||
// Newsletter Button Text
|
||||
$wp_customize->add_setting('newsletter_button_text', array(
|
||||
'default' => 'Subscribe',
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
));
|
||||
$wp_customize->add_control('newsletter_button_text', array(
|
||||
'label' => __('Button Text', 'wisdom1'),
|
||||
'section' => 'wisdom1_newsletter_section',
|
||||
'type' => 'text',
|
||||
));
|
||||
}
|
||||
add_action('customize_register', 'wisdom1_customize_register');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user