label); ?>
get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; $wp_customize->get_setting('header_textcolor')->transport = 'postMessage'; /** * [Panel] * The Next Options */ $wp_customize->add_panel('thenext_theme_options', array( 'title' => __('The Next Options', 'the-next'), 'description' => '', 'priority' => 120, )); /** * * General Settings */ $wp_customize->add_section('thenext_general_options', array( 'title' => __('General', 'the-next'), 'description' => '', 'panel' => 'thenext_theme_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[site_logo]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'site_logo', array( 'label' => __('Site Logo', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[site_logo]', ))); $wp_customize->add_setting('thenext_options[site_logo_footer]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'site_logo_footer', array( 'label' => __('Logo for Footer', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[site_logo_footer]', ))); $wp_customize->add_setting('thenext_options[layout_type]', array( 'default' => 'wide', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('layout_type', array( 'settings' => 'thenext_options[layout_type]', 'label' => 'Layout Type', 'section' => 'thenext_general_options', 'type' => 'select', 'choices' => array( 'wide' => 'Wide', 'boxed' => 'Boxed', 'framed' => 'Framed', ), )); $wp_customize->add_setting('thenext_options[nav_header]', array( 'default' => 'header-1', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('nav_header', array( 'settings' => 'thenext_options[nav_header]', 'label' => 'Navigation Style', 'section' => 'thenext_general_options', 'type' => 'select', 'choices' => array( 'header-1' => 'Nav Style 1', 'header-2' => 'Nav Style 2', 'header-3' => 'Nav Style 3', 'header-4' => 'Left Nav', 'header-5' => 'Nav Style 5', ), )); $wp_customize->add_setting('thenext_options[page_header_style]', array( 'default' => 'style1', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('page_header_style', array( 'settings' => 'thenext_options[page_header_style]', 'label' => 'Page Header Style', 'section' => 'thenext_general_options', 'type' => 'select', 'choices' => array( 'style1' => ' Narrow ', 'style2' => ' Large Centered ', 'style3' => ' Large Left ', 'style4' => ' Large Right ', 'style5' => ' Narrow Extended ', 'style6' => ' Simple Bordered ', ), )); // Color Scheme $wp_customize->add_setting('thenext_options[color_scheme]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color_scheme', array( 'label' => __('Color Scheme', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[color_scheme]', ))); // Main Nav BG $wp_customize->add_setting('thenext_options[main_nav_bg]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'main_nav_bg', array( 'label' => __('Main Nav Background', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[main_nav_bg]', ))); // Main Nav Color $wp_customize->add_setting('thenext_options[main_nav_color]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'main_nav_color', array( 'label' => __('Main Nav Color', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[main_nav_color]', ))); // Link Color $wp_customize->add_setting('thenext_options[a_color]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'a_color', array( 'label' => __('Link Color', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[a_color]', ))); // Link Color Hover $wp_customize->add_setting('thenext_options[ah_color]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'ah_color', array( 'label' => __('Link Hover Color', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[ah_color]', ))); // Menu Hover Color $wp_customize->add_setting('thenext_options[menuh_color]', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'menuh_color', array( 'label' => __('Menu Hover Color', 'the-next'), 'section' => 'thenext_general_options', 'settings' => 'thenext_options[menuh_color]', ))); /** * * Home Settings */ $wp_customize->add_panel('thenext_homepage_options', array( 'title' => __('Custom Homepage', 'the-next'), 'description' => '', 'priority' => 120, )); /** * * Homepage Slider */ $wp_customize->add_section('thenext_home_slider', array( 'title' => __('Homepage Slider', 'the-next'), 'description' => '', 'panel' => 'thenext_homepage_options', 'priority' => 120, )); // ===================== // = Category Dropdown = // ===================== $categories = get_categories(); $cats = array(); $i = 0; foreach ($categories as $category) { if ($i == 0) { $default = $category->cat_ID; $i++; } $cats[$category->cat_ID] = ucfirst($category->name); } $wp_customize->add_setting('thenext_options[home_slider_category]', array( 'default' => $default, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_slider_category', array( 'settings' => 'thenext_options[home_slider_category]', 'label' => __('Slider Category', 'the-next'), 'section' => 'thenext_home_slider', 'type' => 'select', 'choices' => $cats, )); $wp_customize->add_setting('thenext_options[home_slide_count]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_slide_count', array( 'label' => __('Number of Posts', 'the-next'), 'type' => 'number', 'section' => 'thenext_home_slider', 'settings' => 'thenext_options[home_slide_count]', 'input_attrs' => array( 'min' => 1, ) )); /** * * Top Featured Pages */ $wp_customize->add_section('thenext_featured_pages', array( 'title' => __('Top Featured Pages', 'the-next'), 'description' => '', 'panel' => 'thenext_homepage_options', 'priority' => 120, )); // ============================= // = Page Dropdown = // ============================= $wp_customize->add_setting('thenext_options[home_featured_page_1]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_featured_page_1', array( 'label' => __('Featured Page 1', 'the-next'), 'section' => 'thenext_featured_pages', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_featured_page_1]', )); $wp_customize->add_setting('thenext_options[home_featured_page_2]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_featured_page_2', array( 'label' => __('Featured Page 2', 'the-next'), 'section' => 'thenext_featured_pages', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_featured_page_2]', )); $wp_customize->add_setting('thenext_options[home_featured_page_3]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_featured_page_3', array( 'label' => __('Featured Page 3', 'the-next'), 'section' => 'thenext_featured_pages', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_featured_page_3]', )); $wp_customize->add_setting('thenext_options[home_featured_page_4]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_featured_page_4', array( 'label' => __('Featured Page 4', 'the-next'), 'section' => 'thenext_featured_pages', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_featured_page_4]', )); // Call to Action $wp_customize->add_section('thenext_home_cta', array( 'title' => __('Call to Action', 'the-next'), 'description' => '', 'panel' => 'thenext_homepage_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[home_featured_title]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_featured_title', array( 'label' => __('Headline', 'the-next'), 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_title]', )); $wp_customize->add_setting('thenext_options[home_featured_desc]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_featured_desc', array( 'label' => __('Description', 'the-next'), 'type' => 'textarea', 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_desc]', )); $wp_customize->add_setting('thenext_options[home_featured_btntxt]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_featured_btntxt', array( 'label' => __('Button Text', 'the-next'), 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_btntxt]', )); $wp_customize->add_setting('thenext_options[home_featured_btnurl]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('home_featured_btnurl', array( 'label' => __('Button URL', 'the-next'), 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_btnurl]', )); $wp_customize->add_setting('thenext_options[home_featured_btntxt1]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_featured_btntxt1', array( 'label' => __('Second Button Text', 'the-next'), 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_btntxt1]', )); $wp_customize->add_setting('thenext_options[home_featured_btnurl1]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('home_featured_btnurl1', array( 'label' => __('Second Button URL', 'the-next'), 'section' => 'thenext_home_cta', 'settings' => 'thenext_options[home_featured_btnurl1]', )); /** * * Features Section */ $wp_customize->add_section('thenext_features_section', array( 'title' => __('Features Section', 'the-next'), 'description' => '', 'panel' => 'thenext_homepage_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[home_feature_title]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('home_feature_title', array( 'label' => __('Headline', 'the-next'), 'section' => 'thenext_features_section', 'settings' => 'thenext_options[home_feature_title]', )); $wp_customize->add_setting('thenext_options[home_feature_image]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'home_feature_image', array( 'label' => __('Featured Image', 'the-next'), 'description' => 'Ideal size 940px X 782px', 'section' => 'thenext_features_section', 'settings' => 'thenext_options[home_feature_image]', ))); /** * * Home Feature Pages */ $wp_customize->add_setting('thenext_options[home_feature_page_1]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_1', array( 'label' => __('Feature Page 1', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_1]', )); $wp_customize->add_setting('thenext_options[home_feature_page_2]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_2', array( 'label' => __('Feature Page 2', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_2]', )); $wp_customize->add_setting('thenext_options[home_feature_page_3]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_3', array( 'label' => __('Feature Page 3', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_3]', )); $wp_customize->add_setting('thenext_options[home_feature_page_4]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_4', array( 'label' => __('Feature Page 4', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_4]', )); $wp_customize->add_setting('thenext_options[home_feature_page_5]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_5', array( 'label' => __('Feature Page 5', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_5]', )); $wp_customize->add_setting('thenext_options[home_feature_page_6]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_6', array( 'label' => __('Feature Page 6', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_6]', )); $wp_customize->add_setting('thenext_options[home_feature_page_7]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_7', array( 'label' => __('Feature Page 7', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_7]', )); $wp_customize->add_setting('thenext_options[home_feature_page_8]', array( 'capability' => 'edit_theme_options', 'default' => 0, 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('home_feature_page_8', array( 'label' => __('Feature Page 8', 'the-next'), 'section' => 'thenext_features_section', 'type' => 'dropdown-pages', 'settings' => 'thenext_options[home_feature_page_8]', )); /** * * Tabbed Section */ $wp_customize->add_section('thenext_home_tab_section', array( 'title' => __('Tabbed Section', 'the-next'), 'description' => '', 'panel' => 'thenext_homepage_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[tabbed_section_title]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('tabbed_section_title', array( 'label' => __('Headline', 'the-next'), 'section' => 'thenext_home_tab_section', 'settings' => 'thenext_options[tabbed_section_title]', )); $wp_customize->add_setting('thenext_options[tabbed_section_desc]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('tabbed_section_desc', array( 'label' => __('Description', 'the-next'), 'type' => 'textarea', 'section' => 'thenext_home_tab_section', 'settings' => 'thenext_options[tabbed_section_desc]', )); // Category Dropdown $wp_customize->add_setting('thenext_options[wpdm_category_1]', array( 'default' => $default, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('wpdm_category_1', array( 'settings' => 'thenext_options[wpdm_category_1]', 'label' => __('Post Category for First Tab', 'the-next'), 'section' => 'thenext_home_tab_section', 'type' => 'select', 'choices' => $cats, )); $wp_customize->add_setting('thenext_options[wpdm_category_2]', array( 'default' => $default, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('wpdm_category_2', array( 'settings' => 'thenext_options[wpdm_category_2]', 'label' => __('Post Category for Second Tab', 'the-next'), 'section' => 'thenext_home_tab_section', 'type' => 'select', 'choices' => $cats, )); $wp_customize->add_setting('thenext_options[wpdm_category_3]', array( 'default' => $default, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('wpdm_category_3', array( 'settings' => 'thenext_options[wpdm_category_3]', 'label' => __('Post Category for Third Tab', 'the-next'), 'section' => 'thenext_home_tab_section', 'type' => 'select', 'choices' => $cats, )); /** * Layouts * * */ $wp_customize->add_panel('thenext_layouts', array( 'title' => __('Layouts', 'the-next'), 'description' => '', 'priority' => 120, )); /** * * Front-Page Layout */ $wp_customize->add_section('thenext_front_page_layout', array( 'title' => __('Front / Blog Page Layout', 'the-next'), 'description' => '', 'panel' => 'thenext_layouts', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[layout_front_page]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Layout_Picker_Custom_Control($wp_customize, 'layout_front_page', array( 'label' => __('Sidebar Layout', 'the-next'), 'description' => '', 'type' => 'layout', 'section' => 'thenext_front_page_layout', 'settings' => 'thenext_options[layout_front_page]', ))); // Left Sidebar $wp_customize->add_setting('thenext_options[front_page_ls]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); global $wp_registered_sidebars; $sidebars = array(); $sidebars[''] = 'Do not apply'; foreach ($wp_registered_sidebars as $sidebar) { $sid = $sidebar['id']; $sidebars[$sid] = $sidebar['name']; } $wp_customize->add_control('front_page_ls', array( 'settings' => 'thenext_options[front_page_ls]', 'label' => __('Left Sidebar', 'the-next'), 'section' => 'thenext_front_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Left Sidebar Width $wp_customize->add_setting('thenext_options[front_page_ls_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('front_page_ls_width', array( 'settings' => 'thenext_options[front_page_ls_width]', 'label' => __('Left Sidebar Width', 'the-next'), 'section' => 'thenext_front_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); // Right Sidebar $wp_customize->add_setting('thenext_options[front_page_rs]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('front_page_rs', array( 'settings' => 'thenext_options[front_page_rs]', 'label' => __('Right Sidebar', 'the-next'), 'section' => 'thenext_front_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Right Sidebar Width $wp_customize->add_setting('thenext_options[front_page_rs_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('front_page_rs_width', array( 'settings' => 'thenext_options[front_page_rs_width]', 'label' => __('Right Sidebar Width', 'the-next'), 'section' => 'thenext_front_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); /** * * Default Post Layout */ $wp_customize->add_section('thenext_default_post_layout', array( 'title' => __('Default Post Layout', 'the-next'), 'description' => '', 'panel' => 'thenext_layouts', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[layout_default_post]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Layout_Picker_Custom_Control($wp_customize, 'layout_default_post', array( 'label' => __('Sidebar Layout', 'the-next'), 'description' => '', 'type' => 'layout', 'section' => 'thenext_default_post_layout', 'settings' => 'thenext_options[layout_default_post]', ))); // Left Sidebar $wp_customize->add_setting('thenext_options[default_post_ls]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_post_ls', array( 'settings' => 'thenext_options[default_post_ls]', 'label' => __('Left Sidebar', 'the-next'), 'section' => 'thenext_default_post_layout', 'type' => 'select', 'choices' => $sidebars, )); // Left Sidebar Width $wp_customize->add_setting('thenext_options[default_post_ls_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_post_ls_width', array( 'settings' => 'thenext_options[default_post_ls_width]', 'label' => __('Left Sidebar Width', 'the-next'), 'section' => 'thenext_default_post_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); // Right Sidebar $wp_customize->add_setting('thenext_options[default_post_rs]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_post_rs', array( 'settings' => 'thenext_options[default_post_rs]', 'label' => __('Right Sidebar', 'the-next'), 'section' => 'thenext_default_post_layout', 'type' => 'select', 'choices' => $sidebars, )); // Right Sidebar Width $wp_customize->add_setting('thenext_options[default_post_rs_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_post_rs_width', array( 'settings' => 'thenext_options[default_post_rs_width]', 'label' => __('Right Sidebar Width', 'the-next'), 'section' => 'thenext_default_post_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); /** * * Default Page Layout */ $wp_customize->add_section('thenext_default_page_layout', array( 'title' => __('Default Page Layout', 'the-next'), 'description' => '', 'panel' => 'thenext_layouts', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[layout_default_page]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Layout_Picker_Custom_Control($wp_customize, 'layout_default_page', array( 'label' => __('Sidebar Layout', 'the-next'), 'description' => '', 'type' => 'layout', 'section' => 'thenext_default_page_layout', 'settings' => 'thenext_options[layout_default_page]', ))); // Left Sidebar $wp_customize->add_setting('thenext_options[default_page_ls]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_page_ls', array( 'settings' => 'thenext_options[default_page_ls]', 'label' => __('Left Sidebar', 'the-next'), 'section' => 'thenext_default_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Left Sidebar Width $wp_customize->add_setting('thenext_options[default_page_ls_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_page_ls_width', array( 'settings' => 'thenext_options[default_page_ls_width]', 'label' => __('Left Sidebar Width', 'the-next'), 'section' => 'thenext_default_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); // Right Sidebar $wp_customize->add_setting('thenext_options[default_page_rs]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_page_rs', array( 'settings' => 'thenext_options[default_page_rs]', 'label' => __('Right Sidebar', 'the-next'), 'section' => 'thenext_default_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Right Sidebar Width $wp_customize->add_setting('thenext_options[default_page_rs_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('default_page_rs_width', array( 'settings' => 'thenext_options[default_page_rs_width]', 'label' => __('Right Sidebar Width', 'the-next'), 'section' => 'thenext_default_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); /** * * Archive Page Layout */ $wp_customize->add_section('thenext_archive_page_layout', array( 'title' => __('Archive Page Layout', 'the-next'), 'description' => '', 'panel' => 'thenext_layouts', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[layout_archive_page]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control(new Layout_Picker_Custom_Control($wp_customize, 'layout_archive_page', array( 'label' => __('Sidebar Layout', 'the-next'), 'description' => '', 'type' => 'layout', 'section' => 'thenext_archive_page_layout', 'settings' => 'thenext_options[layout_archive_page]', ))); // Left Sidebar $wp_customize->add_setting('thenext_options[archive_page_ls]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('archive_page_ls', array( 'settings' => 'thenext_options[archive_page_ls]', 'label' => __('Left Sidebar', 'the-next'), 'section' => 'thenext_archive_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Left Sidebar Width $wp_customize->add_setting('thenext_options[archive_page_ls_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('archive_page_ls_width', array( 'settings' => 'thenext_options[archive_page_ls_width]', 'label' => __('Left Sidebar Width', 'the-next'), 'section' => 'thenext_archive_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); // Right Sidebar $wp_customize->add_setting('thenext_options[archive_page_rs]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('archive_page_rs', array( 'settings' => 'thenext_options[archive_page_rs]', 'label' => __('Right Sidebar', 'the-next'), 'section' => 'thenext_archive_page_layout', 'type' => 'select', 'choices' => $sidebars, )); // Right Sidebar Width $wp_customize->add_setting('thenext_options[archive_page_rs_width]', array( 'default' => '2', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('archive_page_rs_width', array( 'settings' => 'thenext_options[archive_page_rs_width]', 'label' => __('Right Sidebar Width', 'the-next'), 'section' => 'thenext_archive_page_layout', 'type' => 'select', 'choices' => array( '2' => '16.66%', '3' => '25%', '4' => '33.33%', ), )); /** * * Typhography */ $wp_customize->add_panel('thenext_typhography', array( 'title' => __('Typhography', 'the-next'), 'description' => '', 'priority' => 120, )); // Typhography Sections $wp_customize->add_section('thenext_generic_fonts', array( 'title' => __('Generic Fonts', 'the-next'), 'description' => '', 'panel' => 'thenext_typhography', 'priority' => 120, )); $wp_customize->add_section('thenext_post_fonts', array( 'title' => __('Post Fonts', 'the-next'), 'description' => '', 'panel' => 'thenext_typhography', 'priority' => 120, )); $wp_customize->add_section('thenext_widget_fonts', array( 'title' => __('Widget Fonts', 'the-next'), 'description' => '', 'panel' => 'thenext_typhography', 'priority' => 120, )); $wp_customize->add_section('thenext_menu_fonts', array( 'title' => __('Menu Fonts', 'the-next'), 'description' => '', 'panel' => 'thenext_typhography', 'priority' => 120, )); // Typhography Setting and Controls $fontsdata = WPEdenOptionFields::GetFonts(); $fonts = array(); $fonts[''] = 'Default'; foreach($fontsdata as $key => $font){ $fonts[$key] = $font['name']; } /** * * Generic Font Controls */ // Heading Font $wp_customize->add_setting('thenext_options[heading_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('heading_font', array( 'settings' => 'thenext_options[heading_font]', 'label' => __('Header Font', 'the-next'), 'section' => 'thenext_generic_fonts', 'type' => 'select', 'choices' => $fonts, )); //Header Font Style // Body Font $wp_customize->add_setting('thenext_options[body_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('body_font', array( 'settings' => 'thenext_options[body_font]', 'label' => __('Body Font', 'the-next'), 'section' => 'thenext_generic_fonts', 'type' => 'select', 'choices' => $fonts, )); // Heading Font Size $wp_customize->add_setting('thenext_options[heading_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('heading_font_size', array( 'label' => __('Header Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_generic_fonts', 'settings' => 'thenext_options[heading_font_size]', 'input_attrs' => array( 'min' => 20, 'max' => 72, 'step' => 1, ) )); // Body Font Size $wp_customize->add_setting('thenext_options[body_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('body_font_size', array( 'label' => __('Body Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_generic_fonts', 'settings' => 'thenext_options[body_font_size]', 'input_attrs' => array( 'min' => 9, 'max' => 35, 'step' => 1, ) )); // Heading Font Color $wp_customize->add_setting('thenext_options[header_color]', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color', array( 'label' => __('Header Text Color', 'the-next'), 'section' => 'thenext_generic_fonts', 'settings' => 'thenext_options[header_color]', ))); // Body Font Color $wp_customize->add_setting('thenext_options[body_color]', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'body_color', array( 'label' => __('Regular Text Color', 'the-next'), 'section' => 'thenext_generic_fonts', 'settings' => 'thenext_options[body_color]', ))); /** * * Widget Font Controls */ // Widget Title Font $wp_customize->add_setting('thenext_options[widget_title_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('widget_title_font', array( 'settings' => 'thenext_options[widget_title_font]', 'label' => __('Widget Title Font', 'the-next'), 'section' => 'thenext_widget_fonts', 'type' => 'select', 'choices' => $fonts, )); // Widget Content Font $wp_customize->add_setting('thenext_options[widget_content_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('widget_content_font', array( 'settings' => 'thenext_options[widget_content_font]', 'label' => __('Widget Content Font', 'the-next'), 'section' => 'thenext_widget_fonts', 'type' => 'select', 'choices' => $fonts, )); // Widget Title Font Size $wp_customize->add_setting('thenext_options[widget_title_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('widget_title_font_size', array( 'label' => __('Widget Title Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_widget_fonts', 'settings' => 'thenext_options[widget_title_font_size]', 'input_attrs' => array( 'min' => 10, 'max' => 32, 'step' => 1, ) )); // Widget Content Font Size $wp_customize->add_setting('thenext_options[widget_content_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('widget_content_font_size', array( 'label' => __('Widget Content Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_widget_fonts', 'settings' => 'thenext_options[widget_content_font_size]', 'input_attrs' => array( 'min' => 10, 'max' => 32, 'step' => 1, ) )); /** * * Manu Font Controls */ // Menu Top Level Font $wp_customize->add_setting('thenext_options[menu_top_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('menu_top_font', array( 'settings' => 'thenext_options[menu_top_font]', 'label' => __('Menu Top Level Font', 'the-next'), 'section' => 'thenext_menu_fonts', 'type' => 'select', 'choices' => $fonts, )); // Menu Dropdown Font $wp_customize->add_setting('thenext_options[menu_dropdown_font]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('menu_dropdown_font', array( 'settings' => 'thenext_options[menu_dropdown_font]', 'label' => __('Menu Dropdown Font', 'the-next'), 'section' => 'thenext_menu_fonts', 'type' => 'select', 'choices' => $fonts, )); // Menu Top Font Size $wp_customize->add_setting('thenext_options[menu_top_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('menu_top_font_size', array( 'label' => __('Menu Top Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_menu_fonts', 'settings' => 'thenext_options[menu_top_font_size]', 'input_attrs' => array( 'min' => 10, 'max' => 52, 'step' => 1, ) )); // Menu Dropdown Font Size $wp_customize->add_setting('thenext_options[menu_dropdown_font_size]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'intval', )); $wp_customize->add_control('menu_dropdown_font_size', array( 'label' => __('Menu Dropdown Font Size', 'the-next'), 'type' => 'range', 'section' => 'thenext_menu_fonts', 'settings' => 'thenext_options[menu_dropdown_font_size]', 'input_attrs' => array( 'min' => 10, 'max' => 52, 'step' => 1, ) )); /** * * Custom CSS */ $wp_customize->add_section('thenext_custom_css', array( 'title' => __('Custom CSS', 'the-next'), 'description' => '', 'panel' => 'thenext_theme_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[custom_css]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('custom_css', array( 'label' => __('Custom CSS', 'the-next'), 'type' => 'textarea', 'section' => 'thenext_custom_css', 'settings' => 'thenext_options[custom_css]', )); /** * * Social Settings */ $wp_customize->add_section('thenext_social', array( 'title' => __('Social Networks', 'the-next'), 'description' => '', 'panel' => 'thenext_theme_options', 'priority' => 120, )); $wp_customize->add_setting('thenext_options[facebook_profile_url]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('facebook_profile_url', array( 'label' => __('Facebook Profile / Page URL', 'the-next'), 'section' => 'thenext_social', 'settings' => 'thenext_options[facebook_profile_url]', )); $wp_customize->add_setting('thenext_options[twitter_profile_url]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('twitter_profile_url', array( 'label' => __('Twitter Profile URL', 'the-next'), 'section' => 'thenext_social', 'settings' => 'thenext_options[twitter_profile_url]', )); $wp_customize->add_setting('thenext_options[googleplus_profile_url]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('googleplus_profile_url', array( 'label' => __('Google+ Profile / Page URL', 'the-next'), 'section' => 'thenext_social', 'settings' => 'thenext_options[googleplus_profile_url]', )); $wp_customize->add_setting('thenext_options[pinterest_profile_url]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('pinterest_profile_url', array( 'label' => __('Pinterest Profile URL', 'the-next'), 'section' => 'thenext_social', 'settings' => 'thenext_options[pinterest_profile_url]', )); $wp_customize->add_setting('thenext_options[linkedin_profile_url]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control('linkedin_profile_url', array( 'label' => __('Linked In Profile URL', 'the-next'), 'section' => 'thenext_social', 'settings' => 'thenext_options[linkedin_profile_url]', )); /** * * Contact Information */ $wp_customize->add_section('thenext_contact', array( 'title' => __('Contact Info', 'the-next'), 'description' => '', 'panel' => 'thenext_theme_options', 'priority' => 120, )); // Google Map $wp_customize->add_setting('thenext_options[map_address]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('map_address', array( 'label' => __('Google Map Address', 'the-next'), 'section' => 'thenext_contact', 'settings' => 'thenext_options[map_address]', )); // Contact Address $wp_customize->add_setting('thenext_options[contact_address]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('contact_address', array( 'label' => __('Contact Address', 'the-next'), 'type' => 'textarea', 'section' => 'thenext_contact', 'settings' => 'thenext_options[contact_address]', )); // Phone $wp_customize->add_setting('thenext_options[contact_phone]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('contact_phone', array( 'label' => __('Phone', 'the-next'), 'section' => 'thenext_contact', 'settings' => 'thenext_options[contact_phone]', )); // Email $wp_customize->add_setting('thenext_options[contact_email]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'is_email', )); $wp_customize->add_control('contact_email', array( 'label' => __('Email', 'the-next'), 'section' => 'thenext_contact', 'settings' => 'thenext_options[contact_email]', )); // Message $wp_customize->add_setting('thenext_options[contact_thanks_msg]', array( 'default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('contact_thanks_msg', array( 'label' => __('Thank you message', 'the-next'), 'type' => 'textarea', 'section' => 'thenext_contact', 'settings' => 'thenext_options[contact_thanks_msg]', )); } add_action( 'customize_register', 'thenext_customize_register' ); /** * Sanitize html data * @param type $data * @return type */ function thenext_sanitize_html( $data ){ return esc_html($data); } function sanitize_string_input($data){ return sanitize_text_field( $data ); } /** * * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function thenext_customize_preview_js() { wp_enqueue_script( 'thenext_customizer', get_template_directory_uri() . '/admin/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'thenext_customize_preview_js' ); /** * * Customizing Customizer */ function thenext_customizer_style() { wp_enqueue_style( 'thenext-custommizer-controls-styles', get_template_directory_uri() . '/admin/css/thenext-customizer-controls-styles.css' ); wp_enqueue_script( 'thenext-customizer-controls-js', get_template_directory_uri() . '/admin/js/thenext-customizer-controls.js', array( 'jquery', 'customize-controls' ), false, true ); } add_action( 'customize_controls_enqueue_scripts', 'thenext_customizer_style' );