add_section( 'post_page_settings', array( 'title' => __( 'Posts(Blog) & Pages Settings', 'blossom-floral-pro' ), 'priority' => 50, 'panel' => 'general_settings', ) ); /** Prefix Archive Page */ $wp_customize->add_setting( 'ed_prefix_archive', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_prefix_archive', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Prefix in Archive Page', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide prefix in archive page.', 'blossom-floral-pro' ), ) ) ); /** Blog Post Image Crop */ $wp_customize->add_setting( 'ed_crop_blog', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_crop_blog', array( 'section' => 'post_page_settings', 'label' => __( 'Blog Post Image Crop', 'blossom-floral-pro' ), 'description' => __( 'Enable to avoid automatic cropping of featured image in home, archive and search posts.', 'blossom-floral-pro' ), ) ) ); /** Blog Excerpt */ $wp_customize->add_setting( 'ed_excerpt', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_excerpt', array( 'section' => 'post_page_settings', 'label' => __( 'Enable Blog Excerpt', 'blossom-floral-pro' ), 'description' => __( 'Enable to show excerpt or disable to show full post content.', 'blossom-floral-pro' ), ) ) ); /** Excerpt Length */ $wp_customize->add_setting( 'excerpt_length', array( 'default' => 30, 'sanitize_callback' => 'blossom_floral_pro_sanitize_number_absint' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Slider_Control( $wp_customize, 'excerpt_length', array( 'section' => 'post_page_settings', 'label' => __( 'Excerpt Length', 'blossom-floral-pro' ), 'description' => __( 'Automatically generated excerpt length (in words).', 'blossom-floral-pro' ), 'choices' => array( 'min' => 10, 'max' => 100, 'step' => 5, ) ) ) ); /** Blog like */ $wp_customize->add_setting( 'ed_post_like', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_post_like', array( 'section' => 'post_page_settings', 'label' => __( 'Show Like Button In Blog', 'blossom-floral-pro' ), 'description' => __( 'Enable to show like button in blog.', 'blossom-floral-pro' ), ) ) ); $wp_customize->add_setting( 'post_like_title', array( 'default' => __( 'Like', 'blossom-floral-pro' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'post_like_title', array( 'label' => __( 'Like Label', 'blossom-floral-pro' ), 'section' => 'post_page_settings', 'type' => 'text', ) ); $wp_customize->selective_refresh->add_partial( 'post_like_title', array( 'selector' => '.favourite .like-text', 'render_callback' => 'blossom_floral_pro_get_post_like_title', ) ); /** Note */ $wp_customize->add_setting( 'post_note_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Note_Control( $wp_customize, 'post_note_text', array( 'section' => 'post_page_settings', 'description' => sprintf( __( '%s These options affect your individual posts.', 'blossom-floral-pro' ), '
' ), ) ) ); $wp_customize->add_setting( 'ed_post_read_calc', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_post_read_calc', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Read Time', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide post Reading Time.', 'blossom-floral-pro' ), ) ) ); /** Excerpt Length */ $wp_customize->add_setting( 'read_words_per_minute', array( 'default' => 200, 'sanitize_callback' => 'blossom_floral_pro_sanitize_number_absint' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Slider_Control( $wp_customize, 'read_words_per_minute', array( 'section' => 'post_page_settings', 'label' => __( 'Words Per Minute', 'blossom-floral-pro' ), 'description' => __( 'Blog Posts Content Words Reading Speed Per Minute.', 'blossom-floral-pro' ), 'choices' => array( 'min' => 100, 'max' => 1000, 'step' => 10, ) ) ) ); /** Single Post Image Crop */ $wp_customize->add_setting( 'ed_crop_single', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_crop_single', array( 'section' => 'post_page_settings', 'label' => __( 'Single Post Image Crop', 'blossom-floral-pro' ), 'description' => __( 'Enable to avoid automatic cropping of featured image in single post.', 'blossom-floral-pro' ), ) ) ); /** Hide Author Section */ $wp_customize->add_setting( 'ed_author', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_author', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Author Section', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide author section.', 'blossom-floral-pro' ), ) ) ); /** Author Section title */ $wp_customize->add_setting( 'author_title', array( 'default' => __( 'About The Author', 'blossom-floral-pro' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'author_title', array( 'type' => 'text', 'section' => 'post_page_settings', 'label' => __( 'Author Section Title', 'blossom-floral-pro' ), ) ); $wp_customize->selective_refresh->add_partial( 'author_title', array( 'selector' => '.author-section .title', 'render_callback' => 'blossom_floral_pro_get_author_title', ) ); /** Show Related Posts */ $wp_customize->add_setting( 'ed_related', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_related', array( 'section' => 'post_page_settings', 'label' => __( 'Show Related Posts', 'blossom-floral-pro' ), 'description' => __( 'Enable to show related posts in single page.', 'blossom-floral-pro' ), ) ) ); /** Related Posts section title */ $wp_customize->add_setting( 'related_post_title', array( 'default' => __( 'You may also like...', 'blossom-floral-pro' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'related_post_title', array( 'type' => 'text', 'section' => 'post_page_settings', 'label' => __( 'Related Posts Section Title', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_post_page_ac' ) ); $wp_customize->selective_refresh->add_partial( 'related_post_title', array( 'selector' => '.related-posts .title', 'render_callback' => 'blossom_floral_pro_get_related_title', ) ); /** Related Post Taxonomy */ $wp_customize->add_setting( 'related_taxonomy', array( 'default' => 'cat', 'sanitize_callback' => 'blossom_floral_pro_sanitize_radio' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Radio_Buttonset_Control( $wp_customize, 'related_taxonomy', array( 'section' => 'post_page_settings', 'label' => __( 'Related Post Taxonomy', 'blossom-floral-pro' ), 'description' => __( 'Choose Categories/Tags to display related post based on in Single Post.', 'blossom-floral-pro' ), 'choices' => array( 'cat' => __( 'Category', 'blossom-floral-pro' ), 'tag' => __( 'Tags', 'blossom-floral-pro' ), ), 'active_callback' => 'blossom_floral_pro_post_page_ac' ) ) ); /** Comments */ $wp_customize->add_setting( 'ed_comments', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_comments', array( 'section' => 'post_page_settings', 'label' => __( 'Show Comments', 'blossom-floral-pro' ), 'description' => __( 'Enable to show Comments in Single Post/Page.', 'blossom-floral-pro' ), ) ) ); /** Comments Below Post Content */ $wp_customize->add_setting( 'toggle_comments', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'toggle_comments', array( 'section' => 'post_page_settings', 'label' => __( 'Comments Below Post Content', 'blossom-floral-pro' ), 'description' => __( 'Enable to show comment section right after post content. Refresh site for changes.', 'blossom-floral-pro' ), 'active_callback' => 'blossom_floral_pro_post_page_ac' ) ) ); /** Hide Category */ $wp_customize->add_setting( 'ed_category', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_category', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Category', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide category.', 'blossom-floral-pro' ), ) ) ); /** Hide Post Author */ $wp_customize->add_setting( 'ed_post_author', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_post_author', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Post Author', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide post author.', 'blossom-floral-pro' ), ) ) ); /** Hide Posted Date */ $wp_customize->add_setting( 'ed_post_date', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_post_date', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Posted Date', 'blossom-floral-pro' ), 'description' => __( 'Enable to hide posted date.', 'blossom-floral-pro' ), ) ) ); /** Show Featured Image */ $wp_customize->add_setting( 'ed_featured_image', array( 'default' => true, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_featured_image', array( 'section' => 'post_page_settings', 'label' => __( 'Show Featured Image', 'blossom-floral-pro' ), 'description' => __( 'Enable to show featured image in post detail (single post).', 'blossom-floral-pro' ), ) ) ); $wp_customize->add_setting( 'author_signature', array( 'default' => '', 'sanitize_callback' => 'blossom_floral_pro_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'author_signature', array( 'label' => esc_html__( 'Author Signature', 'blossom-floral-pro' ), 'description' => esc_html__( 'Select author signature image of your choice. Recommended size for this image is 250px by 250px. It will be displayed at the end of the single posts.', 'blossom-floral-pro' ), 'section' => 'post_page_settings', 'type' => 'image', ) ) ); /** Toggle Social Links*/ $wp_customize->add_setting( 'ed_toggle_social', array( 'default' => false, 'sanitize_callback' => 'blossom_floral_pro_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Toggle_Control( $wp_customize, 'ed_toggle_social', array( 'section' => 'post_page_settings', 'label' => __( 'Enable Social Links', 'blossom-floral-pro' ), 'description' => __( 'Enable to show social links below the author signature. Works only when author signature image is set and social links are enabled.', 'blossom-floral-pro' ), ) ) ); $wp_customize->add_setting( 'alignment_signature', array( 'default' => 'center', 'sanitize_callback' => 'blossom_floral_pro_sanitize_radio' ) ); $wp_customize->add_control( new Blossom_Floral_Pro_Radio_Buttonset_Control( $wp_customize, 'alignment_signature', array( 'section' => 'post_page_settings', 'label' => __( 'Author Signature Alignment', 'blossom-floral-pro' ), 'description' => __( 'Choose author signature alignment.', 'blossom-floral-pro' ), 'choices' => array( 'left' => __( 'Left', 'blossom-floral-pro' ), 'center' => __( 'Center', 'blossom-floral-pro' ), 'right' => __( 'Right', 'blossom-floral-pro' ), ) ) ) ); /** Posts(Blog) & Pages Settings Ends */ } add_action( 'customize_register', 'blossom_floral_pro_customize_register_general_post_page' );