remove_section( 'themes' ); $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_section( 'static_front_page' )->panel = 'awaken_home_settings'; $wp_customize->get_section( 'background_image' )->panel = 'awaken_styling'; $wp_customize->get_section( 'colors' )->panel = 'awaken_styling'; /** * Header Settings Panel */ $wp_customize->add_panel( 'awaken_header_settings', array( 'title' => __( 'Header Settings', 'awaken' ), 'description' => __( 'Use this panel to set your header settings', 'awaken' ), 'priority' => 25, ) ); // Logo image $wp_customize->add_setting( 'site_logo', array( 'sanitize_callback' => 'awaken_sanitize_image' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'site_logo', array( 'label' => __( 'Site Logo', 'awaken' ), 'section' => 'title_tagline', 'settings' => 'site_logo', 'description' => __( 'Upload a logo for your website. Recommended height for your logo is 135px.', 'awaken' ), ) ) ); // Logo, title and description chooser $wp_customize->add_setting( 'site_title_option', array ( 'default' => 'text-only', 'sanitize_callback' => 'awaken_sanitize_logo_title_select', 'transport' => 'refresh' ) ); $wp_customize->add_control( 'site_title_option', array( 'label' => __( 'Display site title / logo.', 'awaken' ), 'section' => 'title_tagline', 'type' => 'radio', 'description' => __( 'Choose your preferred option.', 'awaken' ), 'choices' => array ( 'text-only' => __( 'Display site title and description only.', 'awaken' ), 'logo-only' => __( 'Display site logo image only.', 'awaken' ), 'text-logo' => __( 'Display both site title and logo image.', 'awaken' ), 'display-none' => __( 'Display none', 'awaken' ) ) ) ); // Site favicon $wp_customize->add_setting( 'site_favicon', array( 'sanitize_callback' => 'awaken_sanitize_image' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'site_favicon', array( 'label' => __( 'Upload a favicon', 'awaken' ), 'section' => 'title_tagline', 'settings' => 'site_favicon', 'description' => __( 'Upload a favicon for your website.', 'awaken' ), ) ) ); // Display site favicon? $wp_customize->add_setting( 'display_site_favicon', array( 'default' => false, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_site_favicon', array( 'settings' => 'display_site_favicon', 'section' => 'title_tagline', 'type' => 'checkbox', 'label' => __( 'Display site favicon?', 'awaken' ), ) ); /** * General settings section. */ $wp_customize->add_section( 'awaken_general_settings', array( 'title' => __( 'General Settings', 'awaken' ), 'description' => __( 'Use this section to set general settings of the site.', 'awaken' ), 'priority' => 30, ) ); // Read more text. $wp_customize->add_setting( 'read_more_text', array( 'default' => '[...]', 'sanitize_callback' => 'awaken_sanitize_html' ) ); $wp_customize->add_control( 'read_more_text', array( 'settings' => 'read_more_text', 'section' => 'awaken_general_settings', 'type' => 'textarea', 'label' => __( 'Read more text', 'awaken' ), 'description' => __( 'Give a read more text for posts. HTML allowed.', 'awaken' ) ) ); // Footer copyright text. $wp_customize->add_setting( 'footer_copyright_text', array( 'default' => sprintf( __( 'Copyright %s. All rights reserved.', 'awaken' ), esc_html( get_bloginfo( 'name' ) ) ), 'sanitize_callback' => 'awaken_sanitize_html' ) ); $wp_customize->add_control( 'footer_copyright_text', array( 'settings' => 'footer_copyright_text', 'section' => 'awaken_general_settings', 'type' => 'textarea', 'label' => __( 'Footer copyright text', 'awaken' ), 'description' => __( 'Copyright or other text to be displayed in the site footer. HTML allowed.', 'awaken' ) ) ); /** * Home Settings section. */ $wp_customize->add_panel( 'awaken_home_settings', array( 'title' => __( 'Homepage Settings', 'awaken' ), 'description' => __( 'Use this panel to set your home page settings', 'awaken' ), 'priority' => 31, ) ); /** * Slider Section. */ $wp_customize->add_section( 'awaken_slider', array( 'title' => __( 'Feartured Slider', 'awaken' ), 'description' => __( 'Use this section to setup the homepage slider and featured posts.', 'awaken' ), 'panel' => 'awaken_home_settings' ) ); // Display slider? $wp_customize->add_setting( 'display_slider', array( 'default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_slider', array( 'settings' => 'display_slider', 'section' => 'awaken_slider', 'type' => 'checkbox', 'label' => __( 'Display slider on homepage ?', 'awaken' ) ) ); $wp_customize->add_setting( 'slider_category', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_category_dropdown' ) ); $wp_customize->add_control( new WP_Customize_Category_Control( $wp_customize, 'slider_category', array( 'label' => __( 'Select the category for slider.', 'awaken' ), 'description' => __( 'Featured images of the posts from selected category will be displayed in the slider', 'awaken' ), 'section' => 'awaken_slider', 'settings' => 'slider_category', ) ) ); $wp_customize->add_setting( 'featured_posts_category', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_category_dropdown' ) ); $wp_customize->add_control( new WP_Customize_Category_Control( $wp_customize, 'featured_posts_category', array( 'label' => __( 'Select the category for featured posts.', 'awaken' ), 'description' => __( 'Featured images of the posts from selected category will be displayed in the slider', 'awaken' ), 'section' => 'awaken_slider', 'settings' => 'featured_posts_category', ) ) ); /** * Post / Page settings */ $wp_customize->add_section( 'awaken_post_page_settings', array( 'title' => __( 'Post / Page Settings', 'awaken' ), 'priority' => 32 ) ); // Show comments on posts. $wp_customize->add_setting( 'display_post_comments', array( 'default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_post_comments', array( 'settings' => 'display_post_comments', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __( 'Display post comments.', 'awaken' ), 'description' => __( 'Mark the checkbox if you want to display comments on post articles.', 'awaken' ) ) ); // Show comments on pages. $wp_customize->add_setting( 'display_page_comments', array( 'default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_page_comments', array( 'settings' => 'display_page_comments', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __( 'Display page comments.', 'awaken' ), 'description' => __( 'Mark the checkbox if you want to display comments on pages.', 'awaken' ) ) ); // Show featured image in single posts. $wp_customize->add_setting( 'show_article_featured_image', array( 'default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'show_article_featured_image', array( 'settings' => 'show_article_featured_image', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __( 'Display featured image inside the single post article.', 'awaken' ), 'description' => __( 'Mark the checkbox if you want to show featured image on single post article.', 'awaken' ) ) ); /** * Styling Options. */ $wp_customize->add_panel( 'awaken_styling', array( 'title' => __( 'Site Styling', 'awaken' ), 'description' => __( 'Use this section to setup the homepage slider and featured posts.', 'awaken' ), 'priority' => 33, ) ); /** * Custom CSS section */ $wp_customize->add_section( 'awaken_custom_css', array( 'title' => __( 'Custom CSS', 'awaken' ), 'panel' => 'awaken_styling', 'priority' => 50 ) ); $wp_customize->add_setting( 'custom_css', array( 'default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'awaken_sanitize_css' ) ); $wp_customize->add_control( 'custom_css', array( 'settings' => 'custom_css', 'section' => 'awaken_custom_css', 'type' => 'textarea', 'label' => __( 'Custom CSS', 'awaken' ), 'description' => __( 'Define custom CSS be used for your site. Do not enclose in script tags.', 'awaken' ), ) ); /** * Social Media */ $wp_customize->add_section( 'awaken_social_media', array( 'title' => __( 'Social Media', 'awaken' ), 'priority' => 34 ) ); $wp_customize->add_setting( 'display_social_icons', array( 'default' => false, 'sanitize_callback' => 'awaken_sanitize_checkbox' ) ); $wp_customize->add_control( 'display_social_icons', array( 'settings' => 'display_social_icons', 'section' => 'awaken_social_media', 'type' => 'checkbox', 'label' => __( 'Display social icons?', 'awaken' ), ) ); $wp_customize->add_setting( 'facebook_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'facebook_url', array( 'settings' => 'facebook_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Facebook URL', 'awaken' ), ) ); $wp_customize->add_setting( 'twitter_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'twitter_url', array( 'settings' => 'twitter_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Twitter URL', 'awaken' ), ) ); $wp_customize->add_setting( 'google_plus_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'google_plus_url', array( 'settings' => 'google_plus_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Google Plus URL', 'awaken' ), ) ); $wp_customize->add_setting( 'linkedin_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'linkedin_url', array( 'settings' => 'linkedin_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Linkedin URL', 'awaken' ), ) ); $wp_customize->add_setting( 'rss_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'rss_url', array( 'settings' => 'rss_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'RSS URL', 'awaken' ), ) ); $wp_customize->add_setting( 'instagram_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'instagram_url', array( 'settings' => 'instagram_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Instagram URL', 'awaken' ), ) ); $wp_customize->add_setting( 'flickr_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'flickr_url', array( 'settings' => 'flickr_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Flickr URL', 'awaken' ), ) ); $wp_customize->add_setting( 'youtube_url', array( 'default' => '', 'sanitize_callback' => 'awaken_sanitize_url' ) ); $wp_customize->add_control( 'youtube_url', array( 'settings' => 'youtube_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __( 'Youtube URL', 'awaken' ), ) ); $wp_customize->add_section( 'awaken_pro_details', array( 'title' => __( 'Awaken Pro', 'awaken' ), 'priority' => 120 ) ); $wp_customize->add_setting( 'awaken_pro_desc', array( 'sanitize_callback' => 'awaken_sanitize_html' ) ); $wp_customize->add_control( new Awaken_Pro_Custom_Content( $wp_customize, 'awaken_pro_desc', array( 'section' => 'awaken_pro_details', 'priority' => 20, 'label' => __( 'Do you want more features?', 'awaken' ), 'content' => __( 'Then consider buying Awaken Pro.