__( '— Select —', 'acosmin' ) ); foreach ( $menus as $menu ) { $choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '…' ); } // Remove some of the default sections $wp_customize->remove_section( 'static_front_page' ); $wp_customize->remove_section( 'nav' ); // Get some settings $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; // Add new sections $wp_customize->add_section( 'acosminblogger_header', array( 'title' => __( 'Header', 'acosmin' ), 'priority' => 35, 'description' => '* If you upload a logo, please resize the window a little. It will update its position.
* If not use the text logo to set up a title.' ) ); $wp_customize->add_section( 'acosminblogger_top_menu', array( 'title' => __( 'Top Menu', 'acosmin' ), 'priority' => 36, ) ); $wp_customize->add_section( 'acosminblogger_top_menu_colors', array( 'title' => __( 'Top Menu Colors', 'acosmin' ), 'priority' => 37, ) ); $wp_customize->add_section( 'acosminblogger_links', array( 'title' => __( 'Global Links Colors', 'acosmin' ), 'priority' => 38, ) ); $wp_customize->add_section( 'acosminblogger_bgs', array( 'title' => __( 'Global Background Colors', 'acosmin' ), 'priority' => 39, ) ); $wp_customize->add_section( 'acosminblogger_borders', array( 'title' => __( 'Global Border Colors', 'acosmin' ), 'priority' => 40, ) ); $wp_customize->add_section( 'acosminblogger_gfc', array( 'title' => __( 'Global Fonts Colors', 'acosmin' ), 'priority' => 41, ) ); $wp_customize->add_section( 'acosminblogger_content', array( 'title' => __( 'Content', 'acosmin' ), 'priority' => 42, ) ); $wp_customize->add_section( 'acosminblogger_minisidebar', array( 'title' => __( 'Mini-Sidebar', 'acosmin' ), 'priority' => 43, 'description' => '* If you add or change a menu title save your changes.' ) ); $wp_customize->add_section( 'acosminblogger_footer', array( 'title' => __( 'Footer', 'acosmin' ), 'priority' => 44, ) ); // Add new settings // -- Header $wp_customize->add_setting( 'ac_logo_image', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_logo', array( 'default' => '#ffffff', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_header', array( 'default' => '#111111', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_image_header', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_header', array( 'default' => $main_color, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_description', array( 'default' => '#666666', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // -- Top Menu $wp_customize->add_setting( 'ac_disable_stickymenu', array( 'default' => false, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'nav_menu_locations[main]', array( 'default' => '', 'capability' => 'edit_theme_options', 'theme_supports' => 'menus', ) ); $wp_customize->add_setting( 'ac_border_color_top_menu', array( 'default' => $main_color, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_top_menu_bot', array( 'default' => $main_color, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_top_menu_inn', array( 'default' => $main_color, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_top_menu', array( 'default' => '#ffffff', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // -- Top Menu Colors $wp_customize->add_setting( 'ac_color_top_menu_links', array( 'default' => '#444444', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_top_menu_submenu_links', array( 'default' => '#be5656', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_top_menu_links_hover', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_top_menu_links_active', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // -- Content $wp_customize->add_setting( 'ac_font_select', array( 'default' => 'style1', 'capability' => 'edit_theme_options', 'transport' => 'refresh', ) ); $wp_customize->add_setting( 'ac_border_color_content', array( 'default' => $main_color, 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_be5656', array( 'default' => '#be5656', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_000000', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_border_color_666666', array( 'default' => '#666666', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_444', array( 'default' => '#444444', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_be5656', array( 'default' => '#be5656', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_hover', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_000', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_666', array( 'default' => '#666666', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_222', array( 'default' => '#222222', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_333', array( 'default' => '#333333', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_bbb', array( 'default' => '#bbbbbb', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_color_aaa', array( 'default' => '#aaaaaa', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // -- Global Background Colors $wp_customize->add_setting( 'ac_background_color_fff', array( 'default' => '#ffffff', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_be5656', array( 'default' => '#be5656', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_e1e1e1', array( 'default' => '#e1e1e1', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_f7f7f7', array( 'default' => '#f7f7f7', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_f2f2f2', array( 'default' => '#f2f2f2', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_background_color_000', array( 'default' => '#000000', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // -- Mini Sidebar $wp_customize->add_setting( 'ac_mini_first_title', array( 'default' => __( 'ex: Categories', 'acosmin' ), 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'nav_menu_locations[mini-first]', array( 'default' => '', 'capability' => 'edit_theme_options', 'theme_supports' => 'menus', ) ); $wp_customize->add_setting( 'ac_mini_second_title', array( 'default' => __( 'ex: Blogroll', 'acosmin' ), 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'nav_menu_locations[mini-second]', array( 'default' => '', 'capability' => 'edit_theme_options', 'theme_supports' => 'menus', ) ); $wp_customize->add_setting( 'ac_disable_minisidebar', array( 'default' => false, 'capability' => 'edit_theme_options', ) ); // -- Footer $wp_customize->add_setting( 'ac_footer_logo_text', array( 'default' => 'Blogger', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); $wp_customize->add_setting( 'ac_footer_copyright_text', array( 'default' => 'Copyright 2013 BLOGGER. All rights reserved.', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', ) ); // Add new controls // -- Header $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ac_logo_image', array( 'label' => __( 'Logo - Image', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_logo_image', ) ) ); /*$wp_customize->add_control( 'ac_logo_text', array( 'label' => __( 'Logo - Text', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_logo_text', ) );*/ $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_logo', array( 'label' => __( 'Logo - Font Color', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_color_logo', ) ) ); /*$wp_customize->add_control( 'ac_description_text', array( 'label' => __( 'Description - Text', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_description_text', ) );*/ $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_description', array( 'label' => __( 'Description - Font Color', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_color_description', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_header', array( 'label' => __( 'Header - Background Color', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_background_color_header', ) ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'ac_background_image_header', array( 'label' => __( 'Header - Background Image', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_background_image_header', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_header', array( 'label' => __( 'Header - Bottom Border Color', 'acosmin' ), 'section' => 'acosminblogger_header', 'settings' => 'ac_border_color_header', ) ) ); // -- Top Menu $wp_customize->add_control('ac_disable_stickymenu', array( 'settings' => 'ac_disable_stickymenu', 'label' => __( 'Disable Fixed Style', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'type' => 'checkbox', )); $wp_customize->add_control( 'nav_menu_locations[main]', array( 'label' => __( 'Select a menu', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'settings' => 'nav_menu_locations[main]', 'type' => 'select', 'choices' => $choices ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_top_menu', array( 'label' => __( 'Border color', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'settings' => 'ac_border_color_top_menu', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_top_menu_bot', array( 'label' => __( 'Bottom border color', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'settings' => 'ac_border_color_top_menu_bot', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_top_menu_inn', array( 'label' => __( 'Inner borders color', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'settings' => 'ac_border_color_top_menu_inn', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_top_menu', array( 'label' => __( 'Background color', 'acosmin' ), 'section' => 'acosminblogger_top_menu', 'settings' => 'ac_background_color_top_menu', ) ) ); // -- Top Menu Colors $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_top_menu_links', array( 'label' => __( 'Main links color', 'acosmin' ), 'section' => 'acosminblogger_top_menu_colors', 'settings' => 'ac_color_top_menu_links', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_top_menu_links_hover', array( 'label' => __( 'Main links color / Hover', 'acosmin' ), 'section' => 'acosminblogger_top_menu_colors', 'settings' => 'ac_color_top_menu_links_hover', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_top_menu_submenu_links', array( 'label' => __( 'Sub-menu links color', 'acosmin' ), 'section' => 'acosminblogger_top_menu_colors', 'settings' => 'ac_color_top_menu_submenu_links', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_top_menu_links_active', array( 'label' => __( 'Main links color / Active', 'acosmin' ), 'section' => 'acosminblogger_top_menu_colors', 'settings' => 'ac_color_top_menu_links_active', ) ) ); // -- Global Links Colors $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_be5656', array( 'label' => __( 'Links - Link/Visited states', 'acosmin' ), 'section' => 'acosminblogger_links', 'settings' => 'ac_color_be5656', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_hover', array( 'label' => __( 'Links - Hover state', 'acosmin' ), 'section' => 'acosminblogger_links', 'settings' => 'ac_color_hover', ) ) ); // -- Global Fonts Colors $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_000', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_000', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_666', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_666' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_222', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_222', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_333', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_333', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_bbb', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_bbb', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_aaa', array( 'section' => 'acosminblogger_gfc', 'settings' => 'ac_color_aaa', ) ) ); // -- Global Background Colors $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_fff', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_fff', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_be5656', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_be5656', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_e1e1e1', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_e1e1e1', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_f7f7f7', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_f7f7f7', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_f2f2f2', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_f2f2f2', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_background_color_000', array( 'section' => 'acosminblogger_bgs', 'settings' => 'ac_background_color_000', ) ) ); // -- Global Borders Colors $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_content', array( 'label' => __( 'Main border color', 'acosmin' ), 'section' => 'acosminblogger_borders', 'settings' => 'ac_border_color_content', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_be5656', array( 'label' => __( 'Other border colors', 'acosmin' ), 'section' => 'acosminblogger_borders', 'settings' => 'ac_border_color_be5656', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_000000', array( 'section' => 'acosminblogger_borders', 'settings' => 'ac_border_color_000000', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_border_color_666666', array( 'section' => 'acosminblogger_borders', 'settings' => 'ac_border_color_666666', ) ) ); // -- Content $wp_customize->add_control('ac_font_select', array( 'label' => __('Select a font family', 'acosmin'), 'section' => 'acosminblogger_content', 'settings' => 'ac_font_select', 'type' => 'select', 'choices' => array( 'style1' => 'Style #1', 'style2' => 'Style #2', 'style3' => 'Style #3', 'style4' => 'Style #4', ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'ac_color_444', array( 'label' => __( 'Default font color', 'acosmin' ), 'section' => 'acosminblogger_content', 'settings' => 'ac_color_444', ) ) ); // -- Mini Sidebar $wp_customize->add_control( 'ac_mini_first_title', array( 'label' => __( 'First Menu - Title', 'acosmin' ), 'section' => 'acosminblogger_minisidebar', 'settings' => 'ac_mini_first_title', ) ); $wp_customize->add_control( 'nav_menu_locations[mini-first]', array( 'label' => __( 'First Menu - Select', 'acosmin' ), 'section' => 'acosminblogger_minisidebar', 'settings' => 'nav_menu_locations[mini-first]', 'type' => 'select', 'choices' => $choices ) ); $wp_customize->add_control( 'ac_mini_second_title', array( 'label' => __( 'Second Menu - Title', 'acosmin' ), 'section' => 'acosminblogger_minisidebar', 'settings' => 'ac_mini_second_title', ) ); $wp_customize->add_control( 'nav_menu_locations[mini-second]', array( 'label' => __( 'Second Menu - Select', 'acosmin' ), 'section' => 'acosminblogger_minisidebar', 'settings' => 'nav_menu_locations[mini-second]', 'type' => 'select', 'choices' => $choices ) ); $wp_customize->add_control('ac_disable_minisidebar', array( 'settings' => 'ac_disable_minisidebar', 'label' => __( 'Disable Mini-Sidebar', 'acosmin' ), 'section' => 'acosminblogger_minisidebar', 'type' => 'checkbox', )); // -- Footer $wp_customize->add_control( 'ac_footer_logo_text', array( 'label' => __( 'Logo text', 'acosmin' ), 'section' => 'acosminblogger_footer', 'settings' => 'ac_footer_logo_text', ) ); $wp_customize->add_control( 'ac_footer_copyright_text', array( 'label' => __( 'Copyright text', 'acosmin' ), 'section' => 'acosminblogger_footer', 'settings' => 'ac_footer_copyright_text', ) ); /* Enque Theme Customiser JS */ if ( $wp_customize->is_preview() && ! is_admin() ) { add_action( 'customize_preview_init', 'acosminbusiness_customize_preview' ); } // Enque JS function acosminbusiness_customize_preview() { wp_enqueue_script( 'ac_js_theme_customizer', get_template_directory_uri() . '/assets/js/theme-customizer.js', array( 'jquery', 'customize-preview' ), '1.0', true ); } } // - END Customizations add_action( 'customize_register', 'acosminblogger_cr' ); /* AC - Output Saved Settings */ function ac_header_output() { $main_color = '#e1e1e1' ?>