add_panel( 'blogpost_general_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( 'General settings' , 'vh'), 'description' => __( 'You can configure your general theme settings here' , 'vh') ) ); // Add Header setting panel and configure settings inside it $wp_customize->add_panel( 'blogpost_social_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( 'Side-menu settings' , 'vh'), 'description' => __( 'You can configure your theme side-menu settings here.' , 'vh') ) ); // Add twitter widget setting panel and configure settings inside it $wp_customize->add_panel( 'blogpost_twitter_settings_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( 'Twitter widget settings' , 'vh'), 'description' => __( 'You can configure your themes twitter widget settings here.' , 'vh') ) ); // Add 404 setting panel and configure settings inside it $wp_customize->add_panel( 'blogpost_404_panel', array( 'priority' => 250, 'capability' => 'edit_theme_options', 'title' => __( '404 page' , 'vh'), 'description' => __( 'You can configure your themes 404 page settings here.' , 'vh') ) ); // Website logo $wp_customize->add_section( 'blogpost_general_logo', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Website logo' , 'vh'), 'description' => __( 'Please upload your logo, recommended logo size should be between 262x80' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_logo', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blogpost_logo', array( 'label' => __( 'Website logo', 'vh' ), 'section' => 'blogpost_general_logo', 'settings' => 'blogpost_logo', ) ) ); // Logo retina ready $wp_customize->add_setting( 'blogpost_logo_retina_ready', array( 'sanitize_callback' => 'blogpost_sanitize_checkbox' ) ); $wp_customize->add_control( 'blogpost_logo_retina_ready', array( 'label' => 'Website logo is Retina ready', 'description' => 'You have to uplaod website logo which is 2x in dimensions. It will automatically scaled down for normal displays and prepared for High resolution displays.', 'section' => 'blogpost_general_logo', 'type' => 'checkbox', ) ); // Page layout $wp_customize->add_section( 'blogpost_general_layout', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'title' => __( 'Layout' , 'vh'), 'description' => __( 'Select a layout style.
(full, left side sidebar, right side sidebar)' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_layout', array( 'default' => 'full', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_layout', array( 'type' => 'radio', 'label' => 'Layout', 'section' => 'blogpost_general_layout', 'choices' => array( 'full' => 'Full', 'right' => 'Right' ) ) ); // Login Screen Logo $wp_customize->add_section( 'blogpost_general_login_logo', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Login Screen Logo' , 'vh'), 'description' => __( 'Upload a custom logo.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_login_logo', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blogpost_login_logo', array( 'label' => __( 'Login Screen Logo', 'vh' ), 'section' => 'blogpost_general_login_logo', 'settings' => 'blogpost_login_logo', ) ) ); // Search background $wp_customize->add_section( 'blogpost_general_search_bg', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Search background' , 'vh'), 'description' => __( 'Upload an image to use as your search background' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_search_background', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blogpost_search_background', array( 'label' => __( 'Search background', 'vh' ), 'section' => 'blogpost_general_search_bg', 'settings' => 'blogpost_search_background', ) ) ); // Show comments at sidebar $wp_customize->add_section( 'blogpost_general_sidebar_comments', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'title' => __( 'Show comments at sidebar' , 'vh'), 'description' => __( 'Remove comment form bottom of the post and relocate it at sidebar.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_sidebar_comments', array( 'sanitize_callback' => 'blogpost_sanitize_checkbox' ) ); $wp_customize->add_control( 'blogpost_sidebar_comments', array( 'label' => 'Show comments at sidebar', 'section' => 'blogpost_general_sidebar_comments', 'type' => 'checkbox', ) ); // Side menu image $wp_customize->add_section( 'blogpost_general_side_image', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'Side menu image' , 'vh'), 'description' => __( 'Upload an image to use as your side menu background' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_side_menu_img', array( 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blogpost_side_menu_img', array( 'label' => __( 'Side menu image', 'vh' ), 'section' => 'blogpost_general_side_image', 'settings' => 'blogpost_side_menu_img', ) ) ); // Blog columns $wp_customize->add_section( 'blogpost_general_blog_columns', array( 'priority' => 70, 'capability' => 'edit_theme_options', 'title' => __( 'Blog columns' , 'vh'), 'description' => __( 'Select in how many columns will the blog posts be divided.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_blog_columns', array( 'default' => '3', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_blog_columns', array( 'type' => 'select', 'label' => 'Blog columns', 'section' => 'blogpost_general_blog_columns', 'choices' => array( '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6' ) ) ); // Custom JavaScript $wp_customize->add_section( 'blogpost_general_js', array( 'priority' => 80, 'capability' => 'edit_theme_options', 'title' => __( 'Custom JavaScript' , 'vh'), 'description' => __( 'Copy your custom JavaScript code here. You have to add any needed html tags yourself.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_custom_js', array( 'default' => '', 'sanitize_callback' => 'blogpost_sanitize_textarea_field' ) ); $wp_customize->add_control( 'blogpost_custom_js', array( 'label' => 'Custom JavaScript', 'section' => 'blogpost_general_js', 'type' => 'textarea', ) ); // Custom CSS $wp_customize->add_section( 'blogpost_general_css', array( 'priority' => 90, 'capability' => 'edit_theme_options', 'title' => __( 'Custom CSS' , 'vh'), 'description' => __( 'Copy your custom CSS code here. Use plain CSS without any html tags.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_custom_css', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_custom_css', array( 'label' => 'Custom CSS', 'section' => 'blogpost_general_css', 'type' => 'textarea', ) ); // Scroll to top $wp_customize->add_section( 'blogpost_general_scrolltotop', array( 'priority' => 100, 'capability' => 'edit_theme_options', 'title' => __( 'Scroll to top' , 'vh'), 'description' => __( 'Do you want to enable "Scroll to Top" button?' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_scrolltotop', array( 'sanitize_callback' => 'blogpost_sanitize_checkbox' ) ); $wp_customize->add_control( 'blogpost_scrolltotop', array( 'label' => 'Scroll to top', 'section' => 'blogpost_general_scrolltotop', 'type' => 'checkbox', ) ); // Featured post $wp_customize->add_section( 'blogpost_featured_post', array( 'priority' => 110, 'capability' => 'edit_theme_options', 'title' => __( 'Featured post' , 'vh'), 'description' => __( 'The ID of the featured post to show at the front page.' , 'vh'), 'panel' => 'blogpost_general_panel' ) ); $wp_customize->add_setting( 'blogpost_featured_post_id', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_featured_post_id', array( 'label' => 'Featured post', 'section' => 'blogpost_featured_post', 'type' => 'text', ) ); // Header twitter $wp_customize->add_section( 'blogpost_social_twitter', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Twitter URL' , 'vh'), 'description' => __( 'Twitter URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialtwitter', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialtwitter', array( 'label' => 'Twitter URL', 'section' => 'blogpost_social_twitter', 'type' => 'text', ) ); // Header facebook $wp_customize->add_section( 'blogpost_social_facebook', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'title' => __( 'Facebook URL' , 'vh'), 'description' => __( 'Facebook URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialfacebook', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialfacebook', array( 'label' => 'Facebook URL', 'section' => 'blogpost_social_facebook', 'type' => 'text', ) ); // Header google plus $wp_customize->add_section( 'blogpost_social_gplus', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'Google+ URL' , 'vh'), 'description' => __( 'Google+ URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialgplus', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialgplus', array( 'label' => 'Google+ URL', 'section' => 'blogpost_social_gplus', 'type' => 'text', ) ); // Header pinterest $wp_customize->add_section( 'blogpost_social_pinterest', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'Pinterest URL' , 'vh'), 'description' => __( 'Pinterest URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialpinterest', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialpinterest', array( 'label' => 'Pinterest URL', 'section' => 'blogpost_social_pinterest', 'type' => 'text', ) ); // Header instagram $wp_customize->add_section( 'blogpost_social_instagram', array( 'priority' => 50, 'capability' => 'edit_theme_options', 'title' => __( 'Instagram URL' , 'vh'), 'description' => __( 'Instagram URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialinstagram', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialinstagram', array( 'label' => 'Instagram URL', 'section' => 'blogpost_social_instagram', 'type' => 'text', ) ); // Header vkontakte $wp_customize->add_section( 'blogpost_social_vkontakte', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'VKontakte URL' , 'vh'), 'description' => __( 'VKontakte URL for your menu social icon.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialvkontakte', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialvkontakte', array( 'label' => 'VKontakte URL', 'section' => 'blogpost_social_vkontakte', 'type' => 'text', ) ); // Menu bottom text $wp_customize->add_section( 'blogpost_social_bottom', array( 'priority' => 70, 'capability' => 'edit_theme_options', 'title' => __( 'Menu bottom text' , 'vh'), 'description' => __( 'Set the text at the bottom of the menu.' , 'vh'), 'panel' => 'blogpost_social_panel' ) ); $wp_customize->add_setting( 'blogpost_socialbottom', array( 'default' => 'Made with [heart] Riga', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_socialbottom', array( 'label' => 'Menu bottom text', 'section' => 'blogpost_social_bottom', 'type' => 'text', ) ); // Consumer key $wp_customize->add_section( 'blogpost_twt_consumer_key', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Consumer key' , 'vh'), 'description' => __( 'Please enter your Twitter API consumer key.' , 'vh'), 'panel' => 'blogpost_twitter_settings_panel' ) ); $wp_customize->add_setting( 'blogpost_twitter_consumer_key', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_twitter_consumer_key', array( 'label' => 'Consumer key', 'section' => 'blogpost_twt_consumer_key', 'type' => 'text', ) ); // Consumer secret $wp_customize->add_section( 'blogpost_twt_consumer_secret', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'title' => __( 'Consumer secret' , 'vh'), 'description' => __( 'Please enter your Twitter API consumer secret.' , 'vh'), 'panel' => 'blogpost_twitter_settings_panel' ) ); $wp_customize->add_setting( 'blogpost_twitter_consumer_secret', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_twitter_consumer_secret', array( 'label' => 'Consumer secret', 'section' => 'blogpost_twt_consumer_secret', 'type' => 'text', ) ); // User token $wp_customize->add_section( 'blogpost_twt_user_token', array( 'priority' => 30, 'capability' => 'edit_theme_options', 'title' => __( 'User token' , 'vh'), 'description' => __( 'Please enter your Twitter API User token.' , 'vh'), 'panel' => 'blogpost_twitter_settings_panel' ) ); $wp_customize->add_setting( 'blogpost_twitter_user_token', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_twitter_user_token', array( 'label' => 'User token', 'section' => 'blogpost_twt_user_token', 'type' => 'text', ) ); // User secret $wp_customize->add_section( 'blogpost_twt_user_secret', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( 'User secret' , 'vh'), 'description' => __( 'Please enter your Twitter API User secret.' , 'vh'), 'panel' => 'blogpost_twitter_settings_panel' ) ); $wp_customize->add_setting( 'blogpost_twitter_user_secret', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_twitter_user_secret', array( 'label' => 'User secret', 'section' => 'blogpost_twt_user_secret', 'type' => 'text', ) ); // 404 page title $wp_customize->add_section( 'blogpost_404_page_title', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( '404 Page Title' , 'vh'), 'description' => __( 'Set the page title that is displayed on the 404 Error Page.' , 'vh'), 'panel' => 'blogpost_404_panel' ) ); $wp_customize->add_setting( 'blogpost_404_title', array( 'default' => 'This is somewhat embarrassing, isn\'t it?', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_404_title', array( 'label' => '404 Page Title', 'section' => 'blogpost_404_page_title', 'type' => 'text', ) ); // 404 page message $wp_customize->add_section( 'blogpost_404_page_message', array( 'priority' => 40, 'capability' => 'edit_theme_options', 'title' => __( '404 Page Message' , 'vh'), 'description' => __( 'Set the message that is displayed on the 404 Error Page.' , 'vh'), 'panel' => 'blogpost_404_panel' ) ); $wp_customize->add_setting( 'blogpost_404_message', array( 'default' => 'It seems we can\'t find what you\'re looking for. Perhaps searching, or one of the links below, can help.', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_404_message', array( 'label' => '404 Page Title', 'section' => 'blogpost_404_page_message', 'type' => 'text', ) ); // Social links $wp_customize->add_section( new blogpost_Customized_Section( $wp_customize, 'blogpost_social_links', array( 'priority' => 300, 'capability' => 'edit_theme_options' ) ) ); $wp_customize->add_setting( 'blogpost_fake_field', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'blogpost_fake_field', array( 'label' => '', 'section' => 'blogpost_social_links', 'type' => 'text' ) ); } add_action( 'customize_register', 'blogpost_customize_register' ); function blogpost_sanitize_textarea_field( $input ) { return esc_js( $input ); } if ( class_exists( 'WP_Customize_Section' ) && !class_exists( 'blogpost_Customized_Section' ) ) { class blogpost_Customized_Section extends WP_Customize_Section { public function render() { $classes = 'accordion-section control-section control-section-' . $this->type; ?>
  • add_help_tab( array( 'id' => 'vh', 'title' => __( 'Blogpost 1.0', 'vh' ), 'content' => '', ) ); } add_action( 'admin_head-themes.php', 'blogpost_contextual_help' ); add_action( 'admin_head-edit.php', 'blogpost_contextual_help' );