get_setting('blogname')->transport = 'refresh'; $wp_customize->get_setting('blogdescription')->transport = 'refresh'; $wp_customize->get_setting('background_color')->transport = 'refresh'; $wp_customize->get_setting('background_image')->transport = 'refresh'; $wp_customize->get_section( 'title_tagline' )->title = __( 'Site Title (Logo) & Tagline', 'blocade' ); $wp_customize->get_section( 'title_tagline' )->priority = 10; $wp_customize->get_section( 'background_image' )->priority = 30; $wp_customize->add_setting('blocade_logo',array( 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control ( new WP_Customize_Image_Control ( $wp_customize,'blocade_logo', array ( 'label' => __( 'Logo', 'blocade' ), 'section' => 'title_tagline', 'settings' => 'blocade_logo', ))); $wp_customize->add_section('author_page',array( 'title' => __('Author Options' , 'blocade'), 'priority' => 60 )); $wp_customize->add_setting('author_bg_image',array( 'default' => get_stylesheet_directory_uri() . '/images/header.jpg', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_setting('author_bg_color',array( 'default' => '#2a2d33', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control ( new WP_Customize_Image_Control ( $wp_customize,'author_bg_image', array ( 'label' => __( 'Author background image', 'blocade' ), 'section' => 'author_page', 'settings' => 'author_bg_image', ))); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'author_bg_color',array( 'label' => __('Author background color','blocade'), 'section' => 'author_page', 'settings' => 'author_bg_color', 'description' => __('.Note:This will only work when you remove author background image.','blocade') ))); $wp_customize->add_section('footer',array( 'title' => __('Footers Options' , 'blocade'), )); $wp_customize->add_setting('credits',array( 'default' => 'Proudly developed in wordpress by Agraj', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_setting('footer_logo',array( 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('credits',array( 'label' => __('Footer Credits','blocade'), 'settings' => 'credits', 'section' => 'footer', 'priority' => 30 )); $wp_customize->add_control ( new WP_Customize_Image_Control ( $wp_customize,'footer_logo', array ( 'label' => __( 'Footer logo', 'blocade' ), 'section' => 'footer', 'settings' => 'footer_logo', 'priority' => 10 ))); $social = array(); $social[] = array( 'default' => "facebook", 'slug' => 'blocade-facebook', 'label' => __('Facebook','blocade'), ); $social[] = array( 'default' => "twitter", 'slug' => 'blocade-twitter', 'label' => __('Twitter','blocade'), ); $social[] = array( 'default' => "googleplus", 'slug' => 'blocade-googleplus', 'label' => __('Googleplus','blocade'), ); $social[] = array( 'default' => "youtube", 'slug' => 'blocade-youtube', 'label' => __('Youtube','blocade'), ); $social[] = array( 'default' => "pinintrest", 'slug' => 'blocade-pin', 'label' => __('Pinintrest','blocade'), ); $social[] = array( 'default' => "dribble", 'slug' => 'blocade-dribble', 'label' => __('Dribble','blocade'), ); $social[] = array( 'default' => "instagram", 'slug' => 'blocade-instagram', 'label' => __('Instagram','blocade'), ); $social[] = array( 'default' => "linkedin", 'slug' => 'blocade-linkedin', 'label' => __('Linkedin','blocade'), ); $social[] = array( 'default' => "flickr", 'slug' => 'blocade-flickr', 'label' => __('Flickr','blocade'), ); $social[] = array( 'default' => "digg", 'slug' => 'blocade-digg', 'label' => __('Digg','blocade'), ); $social[] = array( 'default' => "vimeo", 'slug' => 'blocade-vimeo', 'label' => __('Vimeo','blocade'), ); $social[] = array( 'default' => "rss", 'slug' => 'blocade-rss', 'label' => __('Rss','blocade'), ); $social[] = array( 'default' => "skype", 'slug' => 'blocade-skype', 'label' => __('Skype','blocade'), ); foreach ($social as $s) { # code... $wp_customize->add_setting($s['slug'],array( 'default' => $s['default'], 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( $s['slug'],array( 'label' => $s['label'], 'section' => 'footer', 'settings' => $s['slug'], 'type' => 'text', 'transport' => 'refresh', 'priority' => 20 )); } $wp_customize->add_section('post_options',array( 'title' => __('Post Options' , 'blocade'), 'priority' => 50 )); $wp_customize->add_setting('excerpt_option',array( 'sanitize_callback' => 'blocade_sanitize_checkbox' )); $wp_customize->add_control( 'excerpt_option',array( 'type' => 'checkbox', 'label' => 'Show full post', 'section' => 'post_options', 'priority' => 10 )); $wp_customize->add_setting('featured_image_option',array( 'sanitize_callback' => 'blocade_sanitize_checkbox' )); $wp_customize->add_control( 'featured_image_option', array( 'type' => 'checkbox', 'label' => __('Hide Featured image in post listings ','blocade'), 'section' => 'post_options', 'priority' => 20 )); $wp_customize->add_setting('read_more_text',array( 'default' => 'Continue reading ....', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('read_more_text',array( 'label' => __('Read more and excerpt text','blocade'), 'section' => 'post_options', 'settings' => 'read_more_text', 'priority' => 30 )); $wp_customize->add_setting('author_box',array( 'sanitize_callback' => 'blocade_sanitize_checkbox' )); $wp_customize->add_control( 'author_box',array( 'type' => 'checkbox', 'label' => __('Show author box.','blocade'), 'section' => 'post_options', 'priority' => 50 )); $wp_customize->add_setting('post_navigation',array( 'sanitize_callback' => 'blocade_sanitize_checkbox' )); $wp_customize->add_control( 'post_navigation',array( 'type' => 'checkbox', 'label' => __('Hide previous/post navigation.','blocade'), 'section' => 'post_options', 'priority' => 60 )); } add_action('customize_register','blocade_customize_register'); function blocade_customizer_head() { $author_bg_image = get_theme_mod('author_bg_image'); $author_bg_color = get_theme_mod('author_bg_color'); ?>