get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; // Add custom description to Colors and Background sections. $wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); // Add the featured content section in case it's not already there. $wp_customize->add_section( 'featured_content', array( 'title' => __( 'Featured Content', 'twentyfourteen' ), 'description' => sprintf( __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), admin_url( '/edit.php?tag=featured' ), admin_url( '/edit.php?show_sticky=1' ) ), 'priority' => 130, ) ); // Add the featured content layout setting and control. $wp_customize->add_setting( 'featured_content_layout', array( 'default' => 'grid', ) ); $wp_customize->add_control( 'featured_content_layout', array( 'label' => __( 'Layout', 'twentyfourteen' ), 'section' => 'featured_content', 'type' => 'select', 'choices' => array( 'grid' => __( 'Grid', 'twentyfourteen' ), 'slider' => __( 'Slider', 'twentyfourteen' ), ), ) ); } add_action( 'customize_register', 'twentyfourteen_customize_register' ); /** * Bind JS handlers to make Theme Customizer preview reload changes asynchronously. * * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize_preview_js() { wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20120827', true ); } add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); /** * Add contextual help to the Themes and Post edit screens. * * @since Twenty Fourteen 1.0 * * @return void */ function twentyfourteen_contextual_help() { if ( 'admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow'] ) { return; } get_current_screen()->add_help_tab( array( 'id' => 'twentyfourteen', 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), 'content' => '