get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; /******************** Agama Upgrade ******************************************/ $wp_customize->add_section( 'agama_support_section', array( 'title' => __('Agama Support', 'agama'), 'description' => __('Hey! Buy us a cofee and we shall come with new features and updates. ','agama'), 'priority' => 1, )); $wp_customize->add_setting( 'agama_support', array( 'default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'wp_filter_nohtml_kses', )); $wp_customize->add_control( new Agama_Customize_Agama_upgrade( $wp_customize,'agama_support', array( 'label' => __('Agama Upgrade', 'agama'), 'section' => 'agama_support_section', 'settings' => 'agama_support', ) ) ); /******************** Agama Theme Options Panel ******************************************/ $wp_customize->add_panel('agama_theme_options', array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __('Agama Theme Options', 'agama') )); /******************** Agama Layout Settings ******************************************/ $wp_customize->add_section('agama_layout_section', array( 'title' => __( 'Layout', 'agama' ), 'priority' => 5, 'panel' => 'agama_theme_options' )); // Layout Style $wp_customize->add_setting('agama_layout_style', array( 'default' => 'boxed', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_layout_style', array( 'label' => __( 'Layout Style', 'agama' ), 'description' => __( 'Choose layout style.', 'agama' ), 'section' => 'agama_layout_section', 'settings' => 'agama_layout_style', 'type' => 'select', 'choices' => array ( 'fullwidth' => __( 'Fullwidth', 'agama' ), 'boxed' => __( 'Boxed Layout', 'agama' ) ) ) ) ); // Smooth Scroll $wp_customize->add_setting( 'agama_nicescroll', array( 'default' => true, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_key' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_nicescroll', array( 'label' => __( 'Smooth Scroll', 'agama' ), 'description' => __( 'Enable Smooth Scroll ?', 'agama' ), 'section' => 'agama_layout_section', 'settings' => 'agama_nicescroll', 'type' => 'checkbox' ) ) ); // Back to Top $wp_customize->add_setting( 'agama_to_top', array( 'default' => true, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_key' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_to_top', array( 'label' => __( 'Back to Top', 'agama' ), 'description' => __( 'Enable back to top button ?', 'agama' ), 'section' => 'agama_layout_section', 'settings' => 'agama_to_top', 'type' => 'checkbox' ) ) ); /******************** Agama Logo Settings ******************************************/ $wp_customize->add_section('agama_logo_section', array( 'title' => __( 'Logo', 'agama' ), 'priority' => 10, 'panel' => 'agama_theme_options' )); // Agama Logo $wp_customize->add_setting('agama_logo', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'agama_logo', array( 'label' => __( 'Upload Logo', 'agama' ), 'section' => 'agama_logo_section', 'settings' => 'agama_logo', 'context' => '', 'priority' => 1, ) ) ); /******************** Agama Header Settings ******************************************/ $wp_customize->add_section('agama_header_section', array( 'title' => __('Header', 'agama'), 'priority' => 20, 'panel' => 'agama_theme_options' )); // Top Navigation $wp_customize->add_setting('agama_top_navigation', array( 'default' => 1, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_key' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_top_navigation', array( 'label' => __('Enable Top Navigation', 'agama'), 'description' => __('Works with default header only.', 'agama'), 'section' => 'agama_header_section', 'settings' => 'agama_top_navigation', 'type' => 'checkbox', 'priority' => 1, ) ) ); // Header Style $wp_customize->add_setting( 'agama_header_style', array( 'default' => 'default', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new Agama_Customize_Agama_Headers( $wp_customize, 'agama_header_style', array( 'label' => __( 'Choose Header', 'agama' ), 'description' => __( 'Choose header style.', 'agama' ), 'section' => 'agama_header_section', 'settings' => 'agama_header_style' ) ) ); // Header Top Margin $wp_customize->add_setting( 'agama_header_top_margin', array( 'default' => '0px', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_header_top_margin', array( 'label' => __('Top Margin', 'agama'), 'description' => __('Works with default header only.', 'agama'), 'section' => 'agama_header_section', 'settings' => 'agama_header_top_margin', 'type' => 'select', 'choices' => array ( '0px' => '0px', '1px' => '1px', '2px' => '2px', '3px' => '3px', '4px' => '4px', '5px' => '5px', '10px' => '10px', '15px' => '15px', '20px' => '20px', '25px' => '25px', '50px' => '50px', '100px' => '100px' ) ) ) ); // Header Top Border Size $wp_customize->add_setting( 'agama_header_top_border_size', array( 'default' => '3px', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_header_top_border_size', array( 'label' => __( 'Top Border Size', 'agama' ), 'section' => 'agama_header_section', 'settings' => 'agama_header_top_border_size', 'type' => 'select', 'choices' => array ( '1px' => '1px', '2px' => '2px', '3px' => '3px', '4px' => '4px', '5px' => '5px', '6px' => '6px', '7px' => '7px', '8px' => '8px', '9px' => '9px', '10px' => '10px' ) ) ) ); /******************** Agama Blog Settings ******************************************/ $wp_customize->add_section( 'agama_blog_section', array( 'title' => __('Blog', 'agama'), 'priority' => 40, 'panel' => 'agama_theme_options' )); // Blog Infinite Scroll $wp_customize->add_setting( 'agama_blog_infinite_scroll', array( 'default' => false, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_blog_infinite_scroll', array( 'label' => __('Enable Infinite Scroll ?', 'agama'), 'section' => 'agama_blog_section', 'settings' => 'agama_blog_infinite_scroll', 'type' => 'checkbox' ) ) ); // Blog Layout $wp_customize->add_setting( 'agama_blog_layout', array( 'default' => 'list', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_blog_layout', array( 'label' => __( 'Blog Layout', 'agama' ), 'section' => 'agama_blog_section', 'settings' => 'agama_blog_layout', 'type' => 'select', 'choices' => array ( 'list' => __( 'List Style', 'agama' ), 'grid' => __( 'Grid Style', 'agama' ) ) ) ) ); // Blog Excerpt Lenght $wp_customize->add_setting( 'agama_blog_excerpt', array( 'default' => 60, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_blog_excerpt', array( 'label' => __( 'Blog Excerpt Lenght', 'agama' ), 'section' => 'agama_blog_section', 'settings' => 'agama_blog_excerpt', 'type' => 'select', 'choices' => array ( '20' => 20, '40' => 40, '60' => 60, '80' => 80, '100' => 100, '120' => 120, '140' => 140, '160' => 160, '180' => 180, '200' => 200 ) ) ) ); /******************** Agama Slider Settings ******************************************/ $wp_customize->add_section( 'agama_slider_section', array( 'title' => __( 'Sliders', 'agama' ), 'priority' => 50, 'panel' => 'agama_theme_options' )); // Agama Pro Feature $wp_customize->add_setting( 'agama_sliders', array( 'default' => false, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new Agama_Customize_Agama_Pro( $wp_customize, 'agama_sliders', array( 'label' => __( 'Sliders', 'agama' ), 'section' => 'agama_slider_section', 'settings' => 'agama_sliders', ) ) ); /******************** Agama Typography Settings ******************************************/ $wp_customize->add_section( 'agama_typography_section', array( 'title' => __( 'Typography', 'agama' ), 'priority' => 60, 'panel' => 'agama_theme_options' )); // Agama Pro Feature $wp_customize->add_setting( 'agama_typography', array( 'default' => false, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control( new Agama_Customize_Agama_Pro( $wp_customize, 'agama_typography', array( 'label' => __( 'Typography', 'agama' ), 'section' => 'agama_typography_section', 'settings' => 'agama_typography', ) ) ); /******************** Agama Colours Settings ******************************************/ $wp_customize->add_section( 'colors', array( 'title' => __('Colours', 'agama'), 'priority' => 70, 'panel' => 'agama_theme_options' )); // Agama Primary Color $wp_customize->add_setting('agama_primary_color', array( 'default' => '#f7a805', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'agama_primary_color', array( 'label' => __( 'Agama Primary Color', 'agama' ), 'section' => 'colors', 'settings' => 'agama_primary_color' ) ) ); // Agama Skin $wp_customize->add_setting( 'agama_skin', array( 'default' => 'light', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_skin', array( 'label' => __( 'Skin', 'agama' ), 'section' => 'colors', 'settings' => 'agama_skin', 'type' => 'select', 'choices' => array ( 'light' => __( 'Light', 'agama' ), 'dark' => __( 'Dark', 'agama' ) ) ) ) ); /******************** Agama Social Icons Settings ******************************************/ $wp_customize->add_section( 'agama_social_icons_section', array( 'title' => __( 'Social Icons', 'agama' ), 'priority' => 80, 'panel' => 'agama_theme_options' )); // Social Icons in Top Navigation ? $wp_customize->add_setting( 'agama_top_nav_social', array( 'default' => true, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_key' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_top_nav_social', array( 'label' => __( 'Enable social icons in top nav ?', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'agama_top_nav_social', 'type' => 'checkbox', ) ) ); // Social Icons in Footer ? $wp_customize->add_setting( 'agama_footer_social', array( 'default' => true, 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_key' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_footer_social', array( 'label' => __( 'Enable social icons in footer ?', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'agama_footer_social', 'type' => 'checkbox', ) ) ); // Social URL Target $wp_customize->add_setting( 'agama_social_url_target', array( 'default' => '_self', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_social_url_target', array( 'label' => __( 'Icons URL Target', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'agama_social_url_target', 'type' => 'select', 'choices' => array ( '_self' => '_self', '_blank'=> '_blank' ) ) ) ); // Social Facebook $wp_customize->add_setting( 'social_facebook', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_facebook', array( 'label' => __( 'Facebook URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_facebook', 'type' => 'text', ) ) ); // Social Twitter $wp_customize->add_setting( 'social_twitter', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_twitter', array( 'label' => __( 'Twitter URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_twitter', 'type' => 'text', ) ) ); // Social Flickr $wp_customize->add_setting( 'social_flickr', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_flickr', array( 'label' => __( 'Flickr URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_flickr', 'type' => 'text', ) ) ); // Social RSS $wp_customize->add_setting( 'social_rss', array( 'default' => esc_url_raw( get_bloginfo('rss2_url') ), 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_rss', array( 'label' => __( 'RSS URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_rss', 'type' => 'text', ) ) ); // Social Vimeo $wp_customize->add_setting( 'social_vimeo', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_vimeo', array( 'label' => __( 'Vimeo URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_vimeo', 'type' => 'text', ) ) ); // Social YouTube $wp_customize->add_setting( 'social_youtube', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_youtube', array( 'label' => __( 'Youtube URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_youtube', 'type' => 'text', ) ) ); $wp_customize->add_setting( 'social_instagram', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_instagram', array( 'label' => __( 'Instagram URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_instagram', 'type' => 'text', ) ) ); // Social Pinterest $wp_customize->add_setting( 'social_pinterest', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_pinterest', array( 'label' => __( 'Pinterest URL', 'agama' ), 'section' => 'agama_social_icons_section', 'settings' => 'social_pinterest', 'type' => 'text', ) ) ); // Social Tumblr $wp_customize->add_setting( 'social_tumblr', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_tumblr', array( 'label' => __('Tumblr URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_tumblr', 'type' => 'text', ) ) ); // Social Google+ $wp_customize->add_setting( 'social_google', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_google', array( 'label' => __('Google+ URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_google', 'type' => 'text', ) ) ); // Social Dribbble $wp_customize->add_setting( 'social_dribbble', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_dribbble', array( 'label' => __('Dribbble URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_dribbble', 'type' => 'text', ) ) ); // Social Digg $wp_customize->add_setting( 'social_digg', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_digg', array( 'label' => __('Digg URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_digg', 'type' => 'text', ) ) ); // Social LinkedIn $wp_customize->add_setting( 'social_linkedin', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_linkedin', array( 'label' => __('Linkedin URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_linkedin', 'type' => 'text', ) ) ); // Social Blogger $wp_customize->add_setting( 'social_blogger', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_blogger', array( 'label' => __('Blogger URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_blogger', 'type' => 'text', ) ) ); // Social Skype $wp_customize->add_setting( 'social_skype', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_skype', array( 'label' => __('Skype URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_skype', 'type' => 'text', ) ) ); // Social Forrst $wp_customize->add_setting( 'social_forrst', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_forrst', array( 'label' => __('Forrst URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_forrst', 'type' => 'text', ) ) ); // Social MySpace $wp_customize->add_setting( 'social_myspace', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_myspace', array( 'label' => __('Myspace URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_myspace', 'type' => 'text', ) ) ); // Social Deviantart $wp_customize->add_setting( 'social_deviantart', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_deviantart', array( 'label' => __('Deviantart URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_deviantart', 'type' => 'text', ) ) ); // Social Yahoo $wp_customize->add_setting( 'social_yahoo', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_yahoo', array( 'label' => __('Yahoo URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_yahoo', 'type' => 'text', ) ) ); // Social Reddit $wp_customize->add_setting( 'social_reddit', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_reddit', array( 'label' => __('Reddit URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_reddit', 'type' => 'text', ) ) ); // Social PayPal $wp_customize->add_setting( 'social_paypal', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_paypal', array( 'label' => __('PayPal URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_paypal', 'type' => 'text', ) ) ); // Social DropBox $wp_customize->add_setting( 'social_dropbox', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_dropbox', array( 'label' => __('Dropbox URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_dropbox', 'type' => 'text', ) ) ); // Social SoundCloud $wp_customize->add_setting( 'social_soundcloud', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_soundcloud', array( 'label' => __('Soundcloud URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_soundcloud', 'type' => 'text', ) ) ); // Social VK $wp_customize->add_setting( 'social_vk', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_vk', array( 'label' => __('VK URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_vk', 'type' => 'text', ) ) ); // Social Email $wp_customize->add_setting( 'social_email', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_url_raw' )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'social_email', array( 'label' => __('Email URL', 'agama'), 'section' => 'agama_social_icons_section', 'settings' => 'social_email', 'type' => 'text', ) ) ); /******************** Agama WooCommerce Settings ******************************************/ $wp_customize->add_section( 'agama_woocommerce_section', array( 'title' => __( 'WooCommerce', 'agama' ), 'priority' => 90, 'panel' => 'agama_theme_options' )); // Products per Page $wp_customize->add_setting( 'agama_woocommerce', array( 'default' => '12', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr' )); $wp_customize->add_control( new Agama_Customize_Agama_Pro( $wp_customize, 'agama_woocommerce', array( 'label' => __('Products per Page', 'agama'), 'section' => 'agama_woocommerce_section', 'settings' => 'agama_woocommerce', ) ) ); /******************** Agama Custom CSS ******************************************/ $wp_customize->add_section( 'agama_custom_css_section', array( 'title' => __('Custom CSS', 'agama'), 'priority' => 100, 'panel' => 'agama_theme_options' )); $wp_customize->add_setting( 'agama_custom_css', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_textarea' )); $wp_customize->add_control( new Agama_Customize_Agama_Pro( $wp_customize, 'agama_custom_css', array( 'label' => __( 'Custom CSS', 'agama' ), 'section' => 'agama_custom_css_section', 'settings' => 'agama_custom_css' ) ) ); /******************** Agama Footer Settings ******************************************/ $wp_customize->add_section( 'agama_footer_section', array( 'title' => __('Footer', 'agama'), 'priority' => 110, 'panel' => 'agama_theme_options' )); // Copyright $wp_customize->add_setting( 'agama_footer_copyright', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'esc_textarea' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'agama_footer_copyright', array( 'label' => __( 'Footer Copyright', 'agama' ), 'description' => __( 'Write your own footer copyright.', 'agama' ), 'section' => 'agama_footer_section', 'settings' => 'agama_footer_copyright', 'type' => 'textarea', ) ) ); } add_action( 'customize_register', 'agama_customize_register' ); /** * Enqueue Javascript postMessage handlers for the Customizer. * * Binds JS handlers to make the Customizer preview reload changes asynchronously. * * @since Agama 1.0 */ function agama_customize_preview_js() { wp_register_script( 'agama-customizer', get_template_directory_uri() . '/assets/js/theme-customizer.js', array( 'customize-preview' ), uniqid(), true ); $localize = array( 'skin_url' => esc_url( get_stylesheet_directory_uri() . '/assets/css/skins/' ), 'top_nav_enable' => esc_attr( get_theme_mod( 'agama_top_navigation', true ) ) ); wp_localize_script( 'agama-customizer', 'agama', $localize ); wp_enqueue_script( 'agama-customizer' ); } add_action( 'customize_preview_init', 'agama_customize_preview_js' ); /** * Generating Dynamic CSS * * @since Agama 1.0 */ function agama_customize_css() { global $Agama; ?>