register_control_type( 'astrad_Customize_Image_Radio_Control' ); $wp_customize->register_control_type( 'astrad_Customizer_Heading' ); $wp_customize->get_section( 'title_tagline' )->panel = 'astrad_general_settings_panel'; $wp_customize->get_section( 'title_tagline' )->priority = '5'; $wp_customize->get_section( 'colors' )->panel = 'astrad_general_settings_panel'; $wp_customize->get_section( 'colors' )->priority = '10'; $wp_customize->get_section( 'background_image' )->panel = 'astrad_general_settings_panel'; $wp_customize->get_section( 'background_image' )->priority = '15'; $wp_customize->get_section( 'header_image' )->panel = 'astrad_general_settings_panel'; $wp_customize->get_section( 'header_image' )->priority = '20'; $wp_customize->get_section( 'static_front_page' )->panel = 'astrad_general_settings_panel'; $wp_customize->get_section( 'static_front_page' )->priority = '25'; /** * Add Appearance Settings Panel * * @since 1.0.0 */ $wp_customize->add_panel( 'astrad_general_settings_panel', array( 'priority' => 5, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'General Settings', 'astrad' ), ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for theme * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_theme_color', array( 'default' => '#FF0066', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_theme_color', array( 'label' => esc_html__( 'Theme Color', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for Links * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_link_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_link_color', array( 'label' => esc_html__( 'Link Color', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for buttons * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_btn_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_btn_color', array( 'label' => esc_html__( 'Button Color', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for button border * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_btn_border_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_btn_border_color', array( 'label' => esc_html__( 'Button Border Color', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for button Hover * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_btn_hover_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_btn_hover_color', array( 'label' => esc_html__( 'Button Hover Color', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Color option for button Hover border * * @since 1.0.0 */ $wp_customize->add_setting( 'astrad_btn_hover_border_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'astrad_btn_hover_border_color', array( 'label' => esc_html__( 'Button Border Color on Hover', 'astrad' ), 'section' => 'colors', 'priority' => 5 ) ) ); /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Website layout section * * @since 1.0.0 */ $wp_customize->add_section( 'astrad_website_layout_section', array( 'title' => esc_html__( 'Website Layout', 'astrad' ), 'description' => esc_html__( 'Choose a layout to display your website more effectively.', 'astrad' ), 'priority' => 55, 'panel' => 'astrad_general_settings_panel', ) ); /** * Site layout */ $wp_customize->add_setting( 'astrad_site_layout', array( 'default' => 'fullwidth_layout', 'sanitize_callback' => 'sanitize_key', ) ); $wp_customize->add_control( new astrad_Customize_Image_Radio_Control( $wp_customize, 'astrad_site_layout', array( 'type' => 'astrad-radio-image', 'label' => esc_html__( 'Site Layout', 'astrad' ), 'section' => 'astrad_website_layout_section', 'choices' => array( 'fullwidth_layout' => array( 'label' => esc_html__( 'Full width layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full-1.png' ), 'boxed_layout' => array( 'label' => esc_html__( 'Boxed layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full.png' ), 'frame_layout' => array( 'label' => esc_html__( 'Frame layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full.png' ) ), 'priority' => 5, ) ) ); /** * page sidebar layout */ $wp_customize->add_setting( 'astrad_page_sidebar_layout', array( 'default' => 'right_sidebar', 'sanitize_callback' => 'sanitize_key', ) ); $wp_customize->add_control( new astrad_Customize_Image_Radio_Control( $wp_customize, 'astrad_page_sidebar_layout', array( 'type' => 'astrad-radio-image', 'label' => esc_html__( 'Page Sidebar Layout', 'astrad' ), 'section' => 'astrad_website_layout_section', 'choices' => array( 'no_sidebar' => array( 'label' => esc_html__( 'Full width layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full.png' ), 'left_sidebar' => array( 'label' => esc_html__( 'Left Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/left.png' ), 'right_sidebar' => array( 'label' => esc_html__( 'Right Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/right.png' ) ), 'priority' => 5, ) ) ); /** * Blog sidebar layout */ $wp_customize->add_setting( 'astrad_blog_sidebar_layout', array( 'default' => 'right_sidebar', 'sanitize_callback' => 'sanitize_key', ) ); $wp_customize->add_control( new astrad_Customize_Image_Radio_Control( $wp_customize, 'astrad_blog_sidebar_layout', array( 'type' => 'astrad-radio-image', 'label' => esc_html__( 'Archive Sidebar Layout', 'astrad' ), 'section' => 'astrad_website_layout_section', 'choices' => array( 'no_sidebar' => array( 'label' => esc_html__( 'Full-width layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full.png' ), 'left_sidebar' => array( 'label' => esc_html__( 'Left Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/left.png' ), 'right_sidebar' => array( 'label' => esc_html__( 'Right Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/right.png' ) ), 'priority' => 5, ) ) ); /** * Post( Single-page ) sidebar layout */ $wp_customize->add_setting( 'astrad_single_sidebar_layout', array( 'default' => 'right_sidebar', 'sanitize_callback' => 'sanitize_key', ) ); $wp_customize->add_control( new astrad_Customize_Image_Radio_Control( $wp_customize, 'astrad_single_sidebar_layout', array( 'type' => 'astrad-radio-image', 'label' => esc_html__( 'Post( Single-page ) sidebar Layout', 'astrad' ), 'section' => 'astrad_website_layout_section', 'choices' => array( 'no_sidebar' => array( 'label' => esc_html__( 'Full-width layout', 'astrad' ), 'url' => '%s/assets/images/customizer/full.png' ), 'left_sidebar' => array( 'label' => esc_html__( 'Left Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/left.png' ), 'right_sidebar' => array( 'label' => esc_html__( 'Right Sidebar', 'astrad' ), 'url' => '%s/assets/images/customizer/right.png' ) ), 'priority' => 5, ) ) ); /** * Scroll to top */ $wp_customize->add_setting( 'astrad_scroll_to_top', array( 'default' => 'show', 'sanitize_callback' => 'astrad_sanitize_switch_option', ) ); $wp_customize->add_control( new astrad_Customize_Switch_Control( $wp_customize, 'astrad_scroll_to_top', array( 'type' => 'astrad-switch', 'label' => esc_html__( 'Scroll to top', 'astrad' ), 'description' => esc_html__( 'Show/Hide option for scroll to top icon in bottom', 'astrad' ), 'section' => 'astrad_website_layout_section', 'choices' => array( 'show' => esc_html__( 'Show', 'astrad' ), 'hide' => esc_html__( 'Hide', 'astrad' ), ), 'priority' => 10, ) ) ); }