add_panel( 'anirohotellight_front_page_blog', array( 'title' => __( 'Front page section "Blog"', 'aniro-hotel-light' ), 'description' => __( 'Front page "Blog" - options.', 'aniro-hotel-light' ), 'priority' => 46, ) ); //****************************************************************************** //Add section "Front page section Blog" //****************************************************************************** $wp_customize->add_section( 'anirohotellight_front_page_blog' , array( 'title' => __( 'Front page section "Blog"', 'aniro-hotel-light' ), 'panel' => 'anirohotellight_front_page_blog', 'priority' => 1, 'description' => __( 'Front page "Blog".', 'aniro-hotel-light' ) ) ); /*******************************************************************************************/ //Blog Title $wp_customize->add_setting('anirohotellight_blog_title', array( 'default' => 'From our blog', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_blog_title', array( 'section' => 'anirohotellight_front_page_blog', 'label' => 'Title for "Blog" section:', 'type' => 'text' ) ); /*******************************************************************************************/ //Button text $wp_customize->add_setting('anirohotellight_blog_btn_text', array( 'default' => 'See our Blog', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_blog_btn_text', array( 'section' => 'anirohotellight_front_page_blog', 'label' => 'Button: text for button that will show blog', 'type' => 'text' ) ); /*******************************************************************************************/ //Button link $wp_customize->add_setting('anirohotellight_blog_btn_link', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri' ) ); $wp_customize->add_control('anirohotellight_blog_btn_link', array( 'section' => 'anirohotellight_front_page_blog', 'label' => 'Button: link to blog for button that will show blog', 'type' => 'url' ) ); //blog will show next: $wp_customize->add_setting( 'anirohotellight_blog_show', array( 'default' => 'show-2', 'sanitize_callback' => 'anirohotellight_sanitize_blog_show' ) ); $wp_customize->add_control( 'anirohotellight_blog_show', array( 'type' => 'radio', 'label' => __( 'Front page section "Blog" will show this:', 'aniro-hotel-light' ), 'section' => 'anirohotellight_front_page_blog', 'choices' => array( 'show-1' => __( 'Show popular posts', 'aniro-hotel-light' ), 'show-2' => __( 'Show recent posts', 'aniro-hotel-light' ), 'show-3' => __( 'Show selected posts', 'aniro-hotel-light' ) ) ) ); //******************************************************************************************* //If selected 'Show selected posts or pages' $wp_customize->add_setting('anirohotellight-blog-info', array( 'type' => 'info_control', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new Info( $wp_customize, 'anirohotellight-blog-info', array( 'label' => __('If selected "Show selected posts":', 'aniro-hotel-light'), 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight-blog-info', ) ) ); /*******************************************************************************************/ $wp_customize->add_setting('anirohotellight-blog-second-post-info', array( 'type' => 'info_control', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-blog-second-post-info', array( 'label' => __('Select posts:', 'aniro-hotel-light'), 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight-blog-second-post-info', ) ) ); //******************************************************************************************* // POSTS //******************************************************************************************* //Choose post 1 $wp_customize-> add_setting( 'anirohotellight_choose_blog_post_1', array( 'default' => '', 'sanitization_callback' => 'anirohotellight_sanitize_integer' ) ); $wp_customize-> add_control( new anirohotellight_Main_Slider_Post_Control( $wp_customize, 'anirohotellight_choose_blog_post_1', array( 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight_choose_blog_post_1' ) ) ); //Choose post 2 $wp_customize-> add_setting( 'anirohotellight_choose_blog_post_2', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_integer', 'transport' => 'refresh' ) ); $wp_customize-> add_control( new anirohotellight_Main_Slider_Post_Control( $wp_customize, 'anirohotellight_choose_blog_post_2', array( 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight_choose_blog_post_2' ) ) ); //Choose post 3 $wp_customize-> add_setting( 'anirohotellight_choose_blog_post_3', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_integer', 'transport' => 'refresh' ) ); $wp_customize-> add_control( new anirohotellight_Main_Slider_Post_Control( $wp_customize, 'anirohotellight_choose_blog_post_3', array( 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight_choose_blog_post_3' ) ) ); //Choose post 4 $wp_customize-> add_setting( 'anirohotellight_choose_blog_post_4', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_integer', 'transport' => 'refresh' ) ); $wp_customize-> add_control( new anirohotellight_Main_Slider_Post_Control( $wp_customize, 'anirohotellight_choose_blog_post_4', array( 'section' => 'anirohotellight_front_page_blog', 'settings' => 'anirohotellight_choose_blog_post_4' ) ) ); //****************************************************************************** //Add section "Show/hide section" //****************************************************************************** $wp_customize->add_section( 'front_page_show_hide_blog_section' , array( 'title' => __( 'Show/hide section', 'aniro-hotel-light' ), 'panel' => 'anirohotellight_front_page_blog', 'priority' => 100, 'description' => __( 'Show/hide this section.', 'aniro-hotel-light' ) ) ); /*********************************************/ // Show/hide blog $wp_customize->add_setting('front_page_show_hide_blog', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_checkbox', )); $wp_customize->add_control('front_page_show_hide_blog', array( 'type' => 'checkbox', 'label' => __( 'Hide this section?', 'aniro-hotel-light' ), 'section' => 'front_page_show_hide_blog_section', ) );