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_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' );