add_panel( $panel_id, array( 'priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => 'General', 'description' => '', ) ); /****************************** * // Title & Tagline Section *******************************/ $section_id = 'title_tagline'; // Change panel for Site Title & Tagline Section $site_title = $wp_customize->get_section( $section_id ); $site_title->panel = $panel_id; // Change priority for Site Title $site_title = $wp_customize->get_control( 'blogname' ); $site_title->priority = 15; // Change priority for Site Tagline $site_title = $wp_customize->get_control( 'blogdescription' ); $site_title->priority = 17; $setting_id = $section_id . '_hide_title'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Hide Title', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'checkbox', 'priority' => 16 ) ) ); $setting_id = $section_id . '_hide_tagline'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'absint' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Hide Tagline', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'checkbox', 'priority' => 18 ) ) ); // Change panel for Static Front Page Section $site_title = $wp_customize->get_section( 'static_front_page' ); $site_title->panel = $panel_id; /****************** * // Logo Section *******************/ $section_id = 'logo'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Logo', 'ayyash' ), 'priority' => 35, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_logo'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $setting_id, array( 'label' => __( 'Logo', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_logo_retina'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $setting_id, array( 'label' => __( 'Retina Logo', 'ayyash' ), 'description' => __( 'Will be visible only on devices with screen width more than 2500px', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_favicon'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $setting_id, array( 'label' => __( 'Favicon', 'ayyash' ), 'description' => __( '.png or .ico format. Recommended dimensions 32 x 32 pixels', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); /****************************** * // Social Profiles Section *******************************/ $section_id = 'social'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Social Profiles', 'ayyash' ), 'priority' => 35, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_facebook'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Facebook URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_twitter'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Twitter URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_google'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Google+ URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_linkedin'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'LinkedIn URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_youtube'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Youtube URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_vimeo'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Vimeo URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_instagram'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Instagram URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_flickr'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Flickr URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_pinterest'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Pinterest URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_dribbble'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Dribbble URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); $setting_id = $section_id . '_digg'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Digg URL', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); /****************************** * // Sticky Posts Section *******************************/ $section_id = 'sticky'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Sticky Posts', 'ayyash' ), 'priority' => 35, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_label'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Sticky Label', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id ) ) ); /****************************** * // Custom Section *******************************/ $section_id = 'custom'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Custom', 'ayyash' ), 'priority' => 35, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_css'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'wp_kses' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Custom CSS', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'textarea' ) ) ); /****************************** * // Development Mood Section *******************************/ $section_id = 'devmood'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Development Mood', 'ayyash' ), 'priority' => 99, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_dev_enable'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Enable Development Mood', 'ayyash' ), 'description' => __( 'If you enable development mood theme will load non-minified script and css version so you can make edit. But after completing edit when you will disable the mood you need to make sure about minifying all code manually by aditional tools can be found online.', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'checkbox', 'priority' => 16 ) ) ); /**Enable Disable Compiler*/ $setting_id = $section_id . '_compile_enable'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Enable Compiler', 'ayyash' ), 'description' => __( 'If you want to compile', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'checkbox', 'priority' => 16 ) ) ); /****************************** * // General Configuration Section *******************************/ $section_id = 's_config'; $wp_customize->add_section( $section_id, array( 'title' => __( 'Site Configuration', 'ayyash' ), 'priority' => 99, 'capability' => 'edit_theme_options', 'panel' => $panel_id ) ); $setting_id = $section_id . '_lazyload_enable'; $wp_customize->add_setting( $setting_id, array( 'default' => rox_get_default( $setting_id ), 'type' => 'theme_mod', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, $setting_id, array( 'label' => __( 'Enable Lazy Loading', 'ayyash' ), 'description' => __( 'It will increase your site performence', 'ayyash' ), 'section' => $section_id, 'settings' => $setting_id, 'type' => 'checkbox', 'priority' => 16 ) ) ); } } ?>