add_setting('your_bumbeelbeelogo', array(
'sanitize_callback' => 'esc_url_raw',
));
// Add a control to upload the logo
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'bumbeelbeelogo',
array(
'label' => 'Upload Main Logo',
'section' => 'title_tagline',
'settings' => 'your_bumbeelbeelogo',
)));
}
add_action('customize_register', 'bumbeelbee_customizer_logo_settings');
*/
function bumbeelbeee_custom_logo_setup() {
$defaults = array(
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
);
add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'bumbeelbeee_custom_logo_setup' );
function bumbeelbee_customizer_logo_next_settings($wp_customize)
{
// add a setting for the site logo
$wp_customize->add_setting('your_bumbeelbeesrink_logo', array(
'sanitize_callback' => 'esc_url_raw',
));
// Add a control to upload the logo
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'your_bumbeelbeesrink_logo',
array(
'label' => 'Upload Srinked Logo',
'section' => 'title_tagline',
'settings' => 'your_bumbeelbeesrink_logo',
)));
}
add_action('customize_register', 'bumbeelbee_customizer_logo_next_settings');
/**
* End Logo Setting and Upload Control
*/
/**
* Setting Social Setup
*/
function ct_bumbeelbee_social_array()
{
$social_sites = array(
'twitter' => 'bumbeelbee_twitter_profile',
'facebook' => 'bumbeelbee_facebook_profile',
'instagram' => 'bumbeelbee_instagram_profile',
);
return apply_filters('ct_bumbeelbee_social_array_filter', $social_sites);
}
function bumbeelbee_sections($wp_customize)
{
$social_sites = ct_bumbeelbee_social_array();
// set a priority used to order the social sites
$priority = 5;
// section
$wp_customize->add_section('ct_bumbeelbee_social_media_icons', array(
'title' => __('Social Media Icons', 'bumbeelbee'),
'priority' => 25,
'description' => __('Add the URL for each of your social profiles.', 'bumbeelbee'),
));
// create a setting and control for each social site
foreach ($social_sites as $social_site => $value) {
$label = ucfirst($social_site);
if ($social_site == 'google-plus') {
$label = 'Google Plus';
} elseif ($social_site == 'rss') {
$label = 'RSS';
} elseif ($social_site == 'soundcloud') {
$label = 'SoundCloud';
} elseif ($social_site == 'slideshare') {
$label = 'SlideShare';
} elseif ($social_site == 'codepen') {
$label = 'CodePen';
} elseif ($social_site == 'stumbleupon') {
$label = 'StumbleUpon';
} elseif ($social_site == 'deviantart') {
$label = 'DeviantArt';
} elseif ($social_site == 'hacker-news') {
$label = 'Hacker News';
} elseif ($social_site == 'whatsapp') {
$label = 'WhatsApp';
} elseif ($social_site == 'qq') {
$label = 'QQ';
} elseif ($social_site == 'vk') {
$label = 'VK';
} elseif ($social_site == 'wechat') {
$label = 'WeChat';
} elseif ($social_site == 'tencent-weibo') {
$label = 'Tencent Weibo';
} elseif ($social_site == 'paypal') {
$label = 'PayPal';
} elseif ($social_site == 'email-form') {
$label = 'Contact Form';
}
// setting
$wp_customize->add_setting($social_site, array(
'sanitize_callback' => 'esc_url_raw',
));
// control
$wp_customize->add_control($social_site, array(
'type' => 'url',
'label' => $label,
'section' => 'ct_bumbeelbee_social_media_icons',
'priority' => $priority,
));
// increment the priority for next site
$priority = $priority + 5;
}
}
add_action('customize_register', 'bumbeelbee_sections');
/**
* Create custome field in customizer for email address
**/
/*
* Register Our Customizer Stuff Here
*/
function email_register_bumbeelbeecustomizer($wp_customize)
{
// Create custom panel.
$wp_customize->add_panel('text_blocks', array(
'priority' => 500,
'bumbeelbeesupports' => '',
'title' => __('Email', 'bumbeelbee'),
'description' => __('Set editable text for certain content.', 'bumbeelbee'),
));
// Add Footer Text
// Add section.
$wp_customize->add_section('custom_email_text', array(
'title' => __('Change Email', 'bumbeelbee'),
'panel' => 'text_blocks',
'priority' => 10,
));
// Add setting
$wp_customize->add_setting('email_text_block', array(
'default' => __('default text', 'bumbeelbee'),
'sanitize_callback' => 'bumbeelbee_sanitize_text',
));
// Add control
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
'custom_footer_text',
array(
'label' => __('Email Address', 'bumbeelbee'),
'section' => 'custom_email_text',
'settings' => 'email_text_block',
'type' => 'text',
)
)
);
// Sanitize text
function bumbeelbee_sanitize_text($text)
{
return sanitize_text_field($text);
}
}
add_action('customize_register', 'email_register_bumbeelbeecustomizer');
/**
* Create Footer Setting and Upload Control
*/
function bumbeelbee_footer_customizer($wp_customize)
{
//adding section in wordpress customizer
$wp_customize->add_section('footer_settings_section', array(
'title' => 'Footer Text Section',
));
$wp_customize->add_control(new WP_Customize_Header_Image_Control($wp_customize, 'header_image', array(
'label' => __('Header image', 'bumbeelbee'),
'section' => 'header_image_settings',
'settings' => 'header_image_position',
)
));
$wp_customize->add_control('text_setting', array(
'label' => 'Footer Text Here',
'section' => 'footer_settings_section',
'type' => 'textarea',
));
//adding setting for footer logo
$wp_customize->add_setting('footer_logo', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'footer_logo', array(
'label' => __('Footer Logo', 'bumbeelbee'),
'section' => 'footer_settings_section',
'settings' => 'footer_logo',
)));
}
add_action('customize_register', 'bumbeelbee_footer_customizer');
/**
* End footer Setting and Upload Control
*/
/** FOR SLIDERS */
function bumbeelbee_home_slider($wp_customize) {
// Start of the Slider Options
$wp_customize->add_panel('bumbeelbee_slider_options', array(
'priority' => 520,
'title' => __('Slider Options', 'bumbeelbee'),
'capability' => 'edit_theme_options',
));
// slider section
$wp_customize->add_section('bumbeelbee_slider_activate_section', array(
'priority' => 1,
'title' => __('Activate slider', 'bumbeelbee'),
'panel' => 'bumbeelbee_slider_options',
'description' => __('In order to show a slider, you must have the featured image associated with the respective page choosen from below option.', 'bumbeelbee')
));
// slider pages select
for( $i = 1; $i <= 5; $i++ ) {
$wp_customize->add_section('bumbeelbee_slider_image_section'.$i, array(
'title' => __( 'Slider #', 'bumbeelbee' ).$i,
'panel' => 'bumbeelbee_slider_options',
));
$wp_customize->add_setting('bumbeelbee_slider_image'.$i, array(
'default' => '',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'bumbeelbee_slider_image'.$i, array(
'label' => __( 'Slider Page ', 'bumbeelbee' ).$i,
'section' => 'bumbeelbee_slider_image_section'.$i,
'setting' => 'bumbeelbee_slider_image'.$i,
)));
//title
$wp_customize->add_setting( 'title_slider'.$i, array(
'default' => ( '' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'bumbeelbee_sanitize_text'
) );
// Add control
$wp_customize->add_control('title_slider'.$i,
array(
'label' => __( 'Enter the Title', 'bumbeelbee' ),
'description' => ''.__('Enter the Tiltle that you want to show.','bumbeelbee').'',
'section' => 'bumbeelbee_slider_image_section'.$i,
)
);
//Description
$wp_customize->add_setting( 'description_slider'.$i, array(
'default' => ( '' ),
'capability' => 'edit_theme_options',
'sanitize_callback' => 'bumbeelbee_sanitize_text'
) );
// Add control
$wp_customize->add_control('description_slider'.$i,
array(
'label' => __( 'Enter the Title', 'bumbeelbee' ),
'description' => ''.__('Enter the Description that you want to show.','bumbeelbee').'',
'section' => 'bumbeelbee_slider_image_section'.$i,
)
);
}
}
add_action('customize_register', 'bumbeelbee_home_slider');
// End of the Slider Options