get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_section( 'header_image' )->panel = 'authorpreneur_header_panel'; $wp_customize->get_section( 'title_tagline' )->priority = '9'; $wp_customize->get_section( 'title_tagline' )->title = __('Site branding', 'authorpreneur'); $wp_customize->remove_control( 'header_textcolor' ); //Titles class authorpreneur_Info extends WP_Customize_Control { public $type = 'info'; public $label = ''; public function render_content() { ?>

label ); ?>

add_panel( 'theme_options', array( 'priority' => 12, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Option', 'authorpreneur'), ) ); $wp_customize->add_section( 'header_section' , array( 'title' => __( 'Header Section', 'authorpreneur' ), 'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_header_search_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_header_search_enable', array( 'type' => 'checkbox', 'label' => __('Enable header search form', 'authorpreneur'), 'section' => 'header_section', //'priority' => 12, ) ); $wp_customize->add_setting('slider_image1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_slider_image1' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image1', array( 'label' => __( 'Slider Image 1', 'authorpreneur' ), 'section' => 'header_section', 'settings' => 'slider_image1', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('slider_image2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_slider_image2' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image2', array( 'label' => __( 'Slider Image 2', 'authorpreneur' ), 'section' => 'header_section', 'settings' => 'slider_image2', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('slider_image3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_slider_image3' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image3', array( 'label' => __( 'Slider Image 3', 'authorpreneur' ), 'section' => 'header_section', 'settings' => 'slider_image3', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'newsletter_shrtcode' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_newsletter_shrtcode' ) ); $wp_customize->add_control( 'newsletter_shrtcode', array( 'label' => __( 'Newsletter', 'authorpreneur' ), 'section' => 'header_section', 'settings' => 'newsletter_shrtcode', 'type' => 'textarea', 'description' => __('Enter shortcode here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_section( 'feature_section' , array( 'title' => __( 'Feature Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_feature_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_feature_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable feature section', 'authorpreneur'), 'section' => 'feature_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_heading' ) ); $wp_customize->add_control( 'sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('sectn_image1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_image1' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sectn_image1', array( 'label' => __( 'Section Image 1', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_image1', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('sectn_image2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_image2' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sectn_image2', array( 'label' => __( 'Section Image 2', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_image2', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('sectn_image3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_image3' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sectn_image3', array( 'label' => __( 'Section Image 3', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_image3', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('sectn_image4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_image4' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sectn_image4', array( 'label' => __( 'Section Image 4', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_image4', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting('sectn_image5', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_sectn_image5' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sectn_image5', array( 'label' => __( 'Section Image 5', 'authorpreneur' ), 'section' => 'feature_section', 'settings' => 'sectn_image5', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_section( 'work_with_section' , array( 'title' => __( 'Work with Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_work_with_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_work_with_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Work With section', 'authorpreneur'), 'section' => 'work_with_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'work_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_heading' ) ); $wp_customize->add_control( 'work_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('work_sectn_image1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image1' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'work_sectn_image1', array( 'label' => __( 'Section Image 1', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image1', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'work_sectn_image_text1' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image_text1' ) ); $wp_customize->add_control( 'work_sectn_image_text1', array( 'label' => __( 'Section Image text 1', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image_text1', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('work_sectn_image2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image2' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'work_sectn_image2', array( 'label' => __( 'Section Image 2', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image2', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'work_sectn_image_text2' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image_text2' ) ); $wp_customize->add_control( 'work_sectn_image_text2', array( 'label' => __( 'Section Image text 2', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image_text2', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('work_sectn_image3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image3' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'work_sectn_image3', array( 'label' => __( 'Section Image 3', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image3', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'work_sectn_image_text3' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_work_sectn_image_text3' ) ); $wp_customize->add_control( 'work_sectn_image_text3', array( 'label' => __( 'Section Image text 3', 'authorpreneur' ), 'section' => 'work_with_section', 'settings' => 'work_sectn_image_text3', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); //Image with text section $wp_customize->add_section( 'image_with_text_section' , array( 'title' => __( 'Image with text Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_image_with_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_image_with_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Image With text section', 'authorpreneur'), 'section' => 'image_with_text_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'image_with_text_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_heading' ) ); $wp_customize->add_control( 'image_with_text_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('image_with_text_sectn_image1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image1' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_with_text_sectn_image1', array( 'label' => __( 'Section Image 1', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image1', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_text1' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_text1' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_text1', array( 'label' => __( 'Section Image text 1', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_text1', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_url1' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_url1' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_url1', array( 'label' => __( 'Section Image text url 1', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_url1', 'type' => 'text', 'description' => __('Enter Url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('image_with_text_sectn_image2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image2' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_with_text_sectn_image2', array( 'label' => __( 'Section Image 2', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image2', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_text2' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_text2' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_text2', array( 'label' => __( 'Section Image text 2', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_text2', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_url2' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_url2' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_url2', array( 'label' => __( 'Section Image text url 2', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_url2', 'type' => 'text', 'description' => __('Enter Url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting('image_with_text_sectn_image3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image3' )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_with_text_sectn_image3', array( 'label' => __( 'Section Image 3', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image3', 'context' => 'your_setting_context1' ) ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_text3' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_text3' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_text3', array( 'label' => __( 'Section Image text 3', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_text3', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'image_with_text_sectn_image_url3' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_image_with_text_sectn_image_url3' ) ); $wp_customize->add_control( 'image_with_text_sectn_image_url3', array( 'label' => __( 'Section Image text url 3', 'authorpreneur' ), 'section' => 'image_with_text_section', 'settings' => 'image_with_text_sectn_image_url3', 'type' => 'text', 'description' => __('Enter Url here', 'authorpreneur'), //'priority' => 3, ) ); //Posts section $wp_customize->add_section( 'post_section' , array( 'title' => __( 'Post Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_post_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_post_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Posts section', 'authorpreneur'), 'section' => 'post_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'post_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_post_sectn_heading' ) ); $wp_customize->add_control( 'post_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'post_section', 'settings' => 'post_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'latest_post_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'latest_post_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Latest Posts', 'authorpreneur'), 'section' => 'post_section', //'priority' => 12, ) ); // $wp_customize->add_setting('multiselect_posts', array( // 'default' => '', // 'transport' => 'refresh' // )); // $wp_customize->add_control( // 'multiselect_posts', // array( // 'type' => 'multiple-select', // 'section' => 'post_section', // 'label' => __( 'Select Posts' ), // 'description' => __( 'This is a custom select option.' ), // 'choices' => authorpreneur_post_choices(), // ) ); //Product section $wp_customize->add_section( 'product_section' , array( 'title' => __( 'Product Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_product_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_product_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Product section', 'authorpreneur'), 'section' => 'product_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'product_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_product_sectn_heading' ) ); $wp_customize->add_control( 'product_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'product_section', 'settings' => 'product_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'latest_products_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'latest_products_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Latest Products', 'authorpreneur'), 'section' => 'product_section', //'priority' => 12, ) ); // $wp_customize->add_setting('multiselect_products', array( // 'default' => '', // 'transport' => 'refresh' // )); // $wp_customize->add_control( // 'multiselect_products', // array( // 'type' => 'multiple-select', // 'section' => 'product_section', // 'label' => __( 'Select Products' ), // 'description' => __( 'This is a custom select option.' ), // 'choices' => authorpreneur_product_choices(), // ) ); //Text grid section $wp_customize->add_section( 'text_grid_section' , array( 'title' => __( 'Text Grid Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_text_grid_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_text_grid_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Text grid section', 'authorpreneur'), 'section' => 'text_grid_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'text_grid_sectn_first_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_text_grid_sectn_first_heading' ) ); $wp_customize->add_control( 'text_grid_sectn_first_heading', array( 'label' => __( 'Section First Heading', 'authorpreneur' ), 'section' => 'text_grid_section', 'settings' => 'text_grid_sectn_first_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'text_grid_sectn_first_content' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_text_grid_sectn_first_content' ) ); $wp_customize->add_control( 'text_grid_sectn_first_content', array( 'label' => __( 'Section First Paragraph', 'authorpreneur' ), 'section' => 'text_grid_section', 'settings' => 'text_grid_sectn_first_content', 'type' => 'textarea', 'description' => __('Enter paragraph here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'text_grid_sectn_second_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_text_grid_sectn_second_heading' ) ); $wp_customize->add_control( 'text_grid_sectn_second_heading', array( 'label' => __( 'Section Second Heading', 'authorpreneur' ), 'section' => 'text_grid_section', 'settings' => 'text_grid_sectn_second_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'text_grid_sectn_second_content' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_text_grid_sectn_second_content' ) ); $wp_customize->add_control( 'text_grid_sectn_second_content', array( 'label' => __( 'Section Second Paragraph', 'authorpreneur' ), 'section' => 'text_grid_section', 'settings' => 'text_grid_sectn_second_content', 'type' => 'textarea', 'description' => __('Enter paragraph here', 'authorpreneur'), //'priority' => 3, ) ); //Follow Me section $wp_customize->add_section( 'follow_me_section' , array( 'title' => __( 'Follow Me Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_follow_me_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_follow_me_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Follow Me section', 'authorpreneur'), 'section' => 'follow_me_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'follow_me_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_heading' ) ); $wp_customize->add_control( 'follow_me_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'follow_me_sectn_fb_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_fb_link' ) ); $wp_customize->add_control( 'follow_me_sectn_fb_link', array( 'label' => __( 'Facebook Url', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_fb_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'follow_me_sectn_tw_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_tw_link' ) ); $wp_customize->add_control( 'follow_me_sectn_tw_link', array( 'label' => __( 'Twitter Url', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_tw_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'follow_me_sectn_insta_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_insta_link' ) ); $wp_customize->add_control( 'follow_me_sectn_insta_link', array( 'label' => __( 'Instagram Url', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_insta_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'follow_me_sectn_li_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_li_link' ) ); $wp_customize->add_control( 'follow_me_sectn_li_link', array( 'label' => __( 'LinkedIn Url', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_li_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'follow_me_sectn_yt_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_follow_me_sectn_yt_link' ) ); $wp_customize->add_control( 'follow_me_sectn_yt_link', array( 'label' => __( 'YouTube Url', 'authorpreneur' ), 'section' => 'follow_me_section', 'settings' => 'follow_me_sectn_yt_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); //Newsletter section $wp_customize->add_section( 'newsletter_section' , array( 'title' => __( 'Newsletter Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_newsletter_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_newsletter_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Newsletter section', 'authorpreneur'), 'section' => 'newsletter_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'newsletter_sectn_heading' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_newsletter_sectn_heading' ) ); $wp_customize->add_control( 'newsletter_sectn_heading', array( 'label' => __( 'Section Heading', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'newsletter_sectn_heading', 'type' => 'text', 'description' => __('Enter heading here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'newsletter_shrtcd_sectn' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_newsletter_shrtcd_sectn' ) ); $wp_customize->add_control( 'newsletter_shrtcd_sectn', array( 'label' => __( 'Newsletter from shortcode', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'newsletter_shrtcd_sectn', 'type' => 'textarea', 'description' => __('Enter shortcode here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'footer_sectn_fb_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_sectn_fb_link' ) ); $wp_customize->add_control( 'footer_sectn_fb_link', array( 'label' => __( 'Facebook Url', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'footer_sectn_fb_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'footer_sectn_tw_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_sectn_tw_link' ) ); $wp_customize->add_control( 'footer_sectn_tw_link', array( 'label' => __( 'Twitter Url', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'footer_sectn_tw_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'footer_sectn_insta_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_sectn_insta_link' ) ); $wp_customize->add_control( 'footer_sectn_insta_link', array( 'label' => __( 'Instagram Url', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'footer_sectn_insta_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'footer_sectn_li_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_sectn_li_link' ) ); $wp_customize->add_control( 'footer_sectn_li_link', array( 'label' => __( 'LinkedIn Url', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'footer_sectn_li_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); $wp_customize->add_setting( 'footer_sectn_yt_link' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_sectn_yt_link' ) ); $wp_customize->add_control( 'footer_sectn_yt_link', array( 'label' => __( 'YouTube Url', 'authorpreneur' ), 'section' => 'newsletter_section', 'settings' => 'footer_sectn_yt_link', 'type' => 'text', 'description' => __('Paste url here', 'authorpreneur'), //'priority' => 3, ) ); //Footer section $wp_customize->add_section( 'footer_section' , array( 'title' => __( 'Footer Section', 'authorpreneur' ), //'priority' => 10, 'panel' => 'theme_options' ) ); $wp_customize->add_setting( 'switch_footer_section_enable', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'switch_footer_section_enable', array( 'type' => 'checkbox', 'label' => __('Enable Footer section', 'authorpreneur'), 'section' => 'footer_section', //'priority' => 12, ) ); $wp_customize->add_setting( 'footer_copyright_sectn' , array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'authorpreneur_sanitize_footer_copyright_sectn' ) ); $wp_customize->add_control( 'footer_copyright_sectn', array( 'label' => __( 'Footer CopyRight area ', 'authorpreneur' ), 'section' => 'footer_section', 'settings' => 'footer_copyright_sectn', 'type' => 'textarea', 'description' => __('Enter copyright text here', 'authorpreneur'), //'priority' => 3, ) ); /*Add custom link*/ // $wp_customize->add_setting( 'test_test' , array( // 'default' => '', // 'transport' => 'refresh', // ) ); // $wp_customize->add_control( // 'test_test', // array( // 'label' => __( 'Facebook Link', 'istorage' ), // 'section' => 'header_section', // 'settings' => 'test_test', // 'type' => 'text', // 'description' => __('Paste the custom URL here. This can be a link from this site or a link from another website. If you do not want the banner to be clickable leave this field blank.', 'istorage'), // 'priority' => 3, // ) // ); //___Blog options___// $wp_customize->add_section( 'blog_options', array( 'title' => __('Blog options', 'authorpreneur'), 'priority' => 13, ) ); // Blog layout $wp_customize->add_setting( 'blog_layout', array( 'default' => 'list', 'sanitize_callback' => 'authorpreneur_sanitize_blog', ) ); $wp_customize->add_control( 'blog_layout', array( 'type' => 'radio', 'label' => __('Blog layout', 'authorpreneur'), 'section' => 'blog_options', 'priority' => 11, 'choices' => array( 'list' => __( 'List', 'authorpreneur' ), 'fullwidth' => __( 'Full width (no sidebar)', 'authorpreneur' ), 'grid-layout' => __( 'Grid style', 'authorpreneur' ) ), ) ); //Full width singles $wp_customize->add_setting( 'fullwidth_single', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'fullwidth_single', array( 'type' => 'checkbox', 'label' => __('Full width single posts?', 'authorpreneur'), 'section' => 'blog_options', 'priority' => 12, ) ); //Excerpt $wp_customize->add_setting( 'exc_length', array( 'sanitize_callback' => 'absint', 'default' => '40', ) ); $wp_customize->add_control( 'exc_length', array( 'type' => 'number', 'priority' => 13, 'section' => 'blog_options', 'label' => __('Excerpt length', 'authorpreneur'), 'input_attrs' => array( 'min' => 10, 'max' => 200, 'step' => 5, ), ) ); //Meta $wp_customize->add_setting( 'hide_meta', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', 'default' => 0, ) ); $wp_customize->add_control( 'hide_meta', array( 'type' => 'checkbox', 'label' => __('Hide post meta?', 'authorpreneur'), 'section' => 'blog_options', 'priority' => 14, ) ); //Index images $wp_customize->add_setting( 'featured_image', array( 'sanitize_callback' => 'authorpreneur_sanitize_checkbox', ) ); $wp_customize->add_control( 'featured_image', array( 'type' => 'checkbox', 'label' => __('Hide featured images?', 'authorpreneur'), 'section' => 'blog_options', 'priority' => 22, ) ); } add_action( 'customize_register', 'authorpreneur_customize_register' ); /** * Sanitize */ //Header type function authorpreneur_sanitize_header( $input ) { if ( in_array( $input, array( 'image', 'shortcode', 'video', 'nothing' ), true ) ) { return $input; } } //Text function authorpreneur_sanitize_text( $input ) { return wp_kses_post( force_balance_tags( $input ) ); } //Checkboxes function authorpreneur_sanitize_checkbox( $input ) { if ( $input == 1 ) { return 1; } else { return ''; } } //Menu style function authorpreneur_sanitize_menu_style( $input ) { if ( in_array( $input, array( 'inline', 'centered' ), true ) ) { return $input; } } //Menu style function authorpreneur_sanitize_sticky( $input ) { if ( in_array( $input, array( 'sticky', 'static' ), true ) ) { return $input; } } //Footer widget areas function authorpreneur_sanitize_fwidgets( $input ) { if ( in_array( $input, array( '1', '2', '3' ), true ) ) { return $input; } } //Blog layout function authorpreneur_sanitize_blog( $input ) { if ( in_array( $input, array( 'list', 'fullwidth', 'grid-layout' ), true ) ) { return $input; } } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function authorpreneur_customize_preview_js() { wp_enqueue_script( 'authorpreneur_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'authorpreneur_customize_preview_js' ); /** * Posts multi-select function */ // function authorpreneur_post_choices() { // $args = array( 'numberposts' => -1, 'post_type' => 'post'); // $myposts = get_posts( $args ); // $choices = array(); // $choices[0] = esc_html__( '--Select--', 'authorpreneur' ); // foreach ( $myposts as $post ) { // $choices[ $post->ID ] = $post->post_title; // } // return $choices; // wp_reset_query(); // } /** * Product multi-select function */ // function authorpreneur_product_choices() { // $args = array( 'numberposts' => -1, 'post_type' => 'product'); // $myproducts = get_posts( $args ); // // echo"
";
// 	// 	print_r($myposts);
// 	// echo"
"; // $choices = array(); // $choices[0] = esc_html__( '--Select--', 'authorpreneur' ); // foreach ( $myproducts as $post ) { // $choices[ $post->ID ] = $post->post_title; // } // return $choices; // wp_reset_query(); // }