add_section( 'alurra_blog_options', array( 'title' => esc_html__( 'Blog Options', 'alurra' ), 'priority' => 22, ) ); // Heading - blog excerpts $wp_customize->add_control( new Alurra_Note_Control( $wp_customize, 'alurra_blog_excerpts_note', array( 'label' => esc_html__( 'Blog Excerpts', 'alurra' ), 'section' => 'alurra_blog_options', 'priority' => 1, 'settings' => array(), ) ) ); /** Blog Excerpt */ $wp_customize->add_setting( 'alurra_blog_excerpt', array( 'default' => 1, 'sanitize_callback' => 'alurra_sanitize_checkbox', ) ); $wp_customize->add_control( new Alurra_Toggle_Control( $wp_customize, 'alurra_blog_excerpt', array( 'section' => 'alurra_blog_options', 'priority' => 2, 'label' => esc_html__( 'Enable Blog Excerpts', 'alurra' ), 'description' => esc_html__( 'Enable to show excerpts or disable to show full post content.', 'alurra' ), ) ) ); /** Excerpt Length */ $wp_customize->add_setting( 'alurra_excerpt_length', array( 'default' => 35, 'sanitize_callback' => 'alurra_sanitize_number_absint', ) ); $wp_customize->add_control( new Alurra_Slider_Control( $wp_customize, 'alurra_excerpt_length', array( 'section' => 'alurra_blog_options', 'priority' => 3, 'label' => esc_html__( 'Excerpt Length', 'alurra' ), 'description' => esc_html__( 'Automatically generated excerpt length (in words).', 'alurra' ), 'choices' => array( 'min' => 10, 'max' => 100, 'step' => 5, ) ) ) ); // Add Partial for Blog Layout and Excerpt Length. $wp_customize->selective_refresh->add_partial( 'alurra_blog_content_partial', array( 'selector' => '.site-main', 'settings' => array( 'alurra_blog_layout', 'alurra_blog_excerpt', 'alurra_excerpt_length', ), 'render_callback' => 'alurra_customize_partial_blog_content', 'fallback_refresh' => false, ) ); } endif; add_action( 'customize_register', 'alurra_customize_register_blog' );