label)) {
echo '' . $this->label . '';
}
if (isset($this->content)) {
echo $this->content;
}
if (isset($this->description)) {
echo '' . $this->description . '';
}
}
}
endif;
/*
* Homepage builder
*/
$wp_customize->add_panel('cb_home_builder', array(
'priority' => 9,
'title' => __('Homepage Builder', 'cafe-bistro'),
'description' => __('Build the home page like the demo', 'cafe-bistro'),
));
$wp_customize->add_section(
'cb_homepage_settings_section',
array(
'title' => __('Header Text & Buttons', 'cafe-bistro'),
'description' => __('After uploading a header image fill this forms to enhance your header.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_about_section',
array(
'title' => __('About Section', 'cafe-bistro'),
'description' => __('Set your about section.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_main_dish_section',
array(
'title' => __('Main Dish Section', 'cafe-bistro'),
'description' => __('The main dish section.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_parallax_section',
array(
'title' => __('Reservation Section', 'cafe-bistro'),
'description' => __('Add a nice reservation section.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_team_section',
array(
'title' => __('Team Section', 'cafe-bistro'),
'description' => __('This is our team section.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_blog_section',
array(
'title' => __('Blog Section', 'cafe-bistro'),
'description' => __('This is our blog section. It shows the 3 latests posts.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_section(
'cb_homepage_contact_section',
array(
'title' => __('Contact Section', 'cafe-bistro'),
'description' => __('This is our contact section. You can use it among with the Contact form 7 plugin.', 'cafe-bistro'),
'panel' => 'cb_home_builder',
)
);
$wp_customize->add_setting(
'cb_header_above_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_header_above_title',
array(
'type' => 'text',
'label' => __('The small text above the header title', 'cafe-bistro'),
'section' => 'cb_homepage_settings_section',
'settings' => 'cb_header_above_title',
));
$wp_customize->add_setting(
'cb_header_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_header_title',
array(
'type' => 'text',
'label' => __('The title of the header.', 'cafe-bistro'),
'section' => 'cb_homepage_settings_section',
'settings' => 'cb_header_title',
));
$wp_customize->add_setting(
'cb_header_below_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_header_below_title',
array(
'type' => 'text',
'label' => __('The small text below the header title', 'cafe-bistro'),
'section' => 'cb_homepage_settings_section',
'settings' => 'cb_header_below_title',
));
$wp_customize->add_setting(
'cb_header_btn_text',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_header_btn_text',
array(
'type' => 'text',
'label' => __('The header button text.', 'cafe-bistro'),
'section' => 'cb_homepage_settings_section',
'settings' => 'cb_header_btn_text',
));
$wp_customize->add_setting(
'cb_header_btn_url',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
)
);
$wp_customize->add_control(
'cb_header_btn_url',
array(
'type' => 'text',
'label' => __('The header button url.', 'cafe-bistro'),
'section' => 'cb_homepage_settings_section',
'settings' => 'cb_header_btn_url',
));
/*
* About Section
*/
$wp_customize->add_setting(
'cb_about_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_about_title',
array(
'type' => 'text',
'label' => __('Add section title.', 'cafe-bistro'),
'section' => 'cb_homepage_about_section',
'settings' => 'cb_about_title',
));
$wp_customize->add_setting(
'cb_about_subtitle',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_about_subtitle',
array(
'type' => 'text',
'label' => __('Add section subtitle.', 'cafe-bistro'),
'section' => 'cb_homepage_about_section',
'settings' => 'cb_about_subtitle',
));
$wp_customize->add_setting(
'cb_about_text',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_about_text',
array(
'type' => 'textarea',
'label' => __('Add section first paragraph text.', 'cafe-bistro'),
'section' => 'cb_homepage_about_section',
'settings' => 'cb_about_text',
));
$wp_customize->add_setting(
'cb_about_2_text',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_about_2_text',
array(
'type' => 'textarea',
'label' => __('Add section second paragraph text.', 'cafe-bistro'),
'section' => 'cb_homepage_about_section',
'settings' => 'cb_about_2_text',
));
$wp_customize->add_setting(
'cb_about_image_1',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'cb_about_image_1',
array(
'label' => __('First About Image, please use an image of 380x290px.', 'cafe-bistro'),
'section' => 'cb_homepage_about_section',
'settings' => 'cb_about_image_1',
)
)
);
/*
* Main dish
*/
$wp_customize->add_setting(
'cb_main_dish_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_title',
array(
'type' => 'text',
'label' => __('Main dish section title', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_title',
));
$wp_customize->add_setting(
'cb_main_dish_subtitle',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_subtitle',
array(
'type' => 'text',
'label' => __('Main dish section subtitle', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_subtitle',
));
$wp_customize->add_setting(
'cb_main_dish_text_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_text_title',
array(
'type' => 'text',
'label' => __('Main title of the text in the main dish section', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_text_title'
));
$wp_customize->add_setting(
'cb_main_dish_paragraph_1',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_paragraph_1',
array(
'type' => 'textarea',
'label' => __('The first paragraph of this section', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_paragraph_1'
));
$wp_customize->add_setting(
'cb_main_dish_paragraph_2',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_paragraph_2',
array(
'type' => 'textarea',
'label' => __('The second paragraph of this section', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_paragraph_2'
));
$wp_customize->add_setting(
'cb_main_dish_btn_txt',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_main_dish_btn_txt',
array(
'type' => 'text',
'label' => __('The text of the button of this section', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_btn_txt'
));
$wp_customize->add_setting(
'cb_main_dish_btn_url',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'cb_main_dish_btn_url',
array(
'type' => 'text',
'label' => __('The URL of the button of this section', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_btn_url'
));
$wp_customize->add_setting(
'cb_main_dish_image',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'cb_main_dish_image',
array(
'label' => __('Upload the main\'s dish image.', 'cafe-bistro'),
'section' => 'cb_homepage_main_dish_section',
'settings' => 'cb_main_dish_image',
)
)
);
/*
* Reservation
*/
$wp_customize->add_setting(
'cb_parallax_image',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'cb_parallax_image',
array(
'label' => __('Reservation Background Image', 'cafe-bistro'),
'section' => 'cb_homepage_parallax_section',
'settings' => 'cb_parallax_image',
)
)
);
$wp_customize->add_setting(
'cb_parallax_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_parallax_title',
array(
'type' => 'text',
'label' => __('Title of the Reservation section', 'cafe-bistro'),
'section' => 'cb_homepage_parallax_section',
'settings' => 'cb_parallax_title',
));
$wp_customize->add_setting(
'cb_parallax_text',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_parallax_text',
array(
'type' => 'textarea',
'label' => __('Small text in the reservation section', 'cafe-bistro'),
'section' => 'cb_homepage_parallax_section',
'settings' => 'cb_parallax_text',
));
$wp_customize->add_setting(
'cb_parallax_btn_text',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_parallax_btn_text',
array(
'type' => 'text',
'label' => __('Reservation button text', 'cafe-bistro'),
'section' => 'cb_homepage_parallax_section',
'settings' => 'cb_parallax_btn_text',
));
$wp_customize->add_setting(
'cb_parallax_btn_url',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
'cb_parallax_btn_url',
array(
'type' => 'text',
'label' => __('Reservation Button URL', 'cafe-bistro'),
'section' => 'cb_homepage_parallax_section',
'settings' => 'cb_parallax_btn_url',
));
/*
* Contact Settings
*/
/** Register Settings **/
$wp_customize->add_setting(
'cb_contact_bg',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'cb_contact_bg',
array(
'label' => __('Use a background image in contact section.', 'cafe-bistro'),
'section' => 'cb_homepage_contact_section',
'settings' => 'cb_contact_bg',
)
)
);
$wp_customize->add_setting(
'cb_contact_bg_color',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'cb_contact_bg_color',
array(
'label' => __('Use a background color fot the contact section.', 'cafe-bistro'),
'section' => 'cb_homepage_contact_section',
'settings' => 'cb_contact_bg_color',
)
)
);
$wp_customize->add_setting(
'cb_contact_title',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_contact_title',
array(
'type' => 'text',
'label' => __('Contact section title.', 'cafe-bistro'),
'section' => 'cb_homepage_contact_section',
'settings' => 'cb_contact_title',
));
$wp_customize->add_setting(
'cb_contact_subtitle',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_contact_subtitle',
array(
'type' => 'text',
'label' => __('Contact section subtitle.', 'cafe-bistro'),
'section' => 'cb_homepage_contact_section',
'settings' => 'cb_contact_subtitle',
));
$wp_customize->add_setting(
'cb_contact_form_shortcode',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'cb_contact_form_shortcode',
array(
'type' => 'text',
'label' => __('Contact form shortcode. Paste it directly from the cf7 plugin.', 'cafe-bistro'),
'section' => 'cb_homepage_contact_section',
'settings' => 'cb_contact_form_shortcode',
));
/** GENERAL SECTION Options**/
$wp_customize->add_section(
'cb_general_settings_section',
array(
'title' => __('General Settings', 'cafe-bistro'),
'description' => __('General Settings for this theme.', 'cafe-bistro'),
'priority' => 10,
)
);
/** Register Settings **/
$wp_customize->add_setting(
'cb_logo_upload',
array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
)
);
$wp_customize->add_setting(
'cb_transparent_header',
array(
'default' => '0',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_setting(
'cb_sticky_menu',
array(
'default' => '0',
'sanitize_callback' => 'sanitize_text_field'
)
);
$wp_customize->add_control(
'cb_transparent_header',
array(
'type' => 'select',
'label' => __('Enable transparent header. Front page', 'cafe-bistro'),
'section' => 'cb_general_settings_section',
'settings' => 'cb_transparent_header',
'choices' => array(
'0' => __('No', 'cafe-bistro'),
'1' => __('Yes', 'cafe-bistro'),
)
));
/** Register Controls **/
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'cb_logo_upload',
array(
'label' => __('Upload a logo', 'cafe-bistro'),
'section' => 'cb_general_settings_section',
'settings' => 'cb_logo_upload',
)
)
);
$wp_customize->add_control(
'cb_sticky_menu',
array(
'type' => 'select',
'label' => __('Make navigation menu sticky', 'cafe-bistro'),
'section' => 'cb_general_settings_section',
'settings' => 'cb_sticky_menu',
'choices' => array(
'0' => __('No', 'cafe-bistro'),
'1' => __('Yes', 'cafe-bistro'),
)
));