add_section ( 'bayeux_chapter_end', array ( 'title' => __( 'Chapter End Text', 'bayeux' ), 'description' => __( 'Brief text that shows up at the end of every few chapters, and the end of the final chapter. Probably to upsell people into merch or the tip jar. Basic HTML is okay!', 'bayeux'), 'priority' => 110, ) ); $wp_customize->add_setting( 'bayeux_chapter_end_copy', array( 'default' => 'If you\'re enjoying this comic, please consider buying the book, supporting me on Patreon, or telling your friends and/or favorite tastemakers about it. Thanks!' ) ); $wp_customize->add_control( 'bayeux_chapter_end_copy', array( 'label' => __( 'Text', 'bayeux' ), 'section' => 'bayeux_chapter_end', 'settings' => 'bayeux_chapter_end_copy', ) ); $wp_customize->add_setting( 'bayeux_chapter_end_frequency', array( 'default' => "4" ) ); $wp_customize->add_control( 'bayeux_chapter_end_frequency', array( 'label' => __( 'Show every nth chapter', 'bayeux' ), 'section' => 'bayeux_chapter_end', 'settings' => 'bayeux_chapter_end_frequency', ) ); // got blurb? $wp_customize->add_section ( 'bayeux_frontmatter', array ( 'title' => __( 'Title page', 'bayeux' ), 'description' => __( 'Synopsis and/or glowing praise from someone famous. And a cover image.', 'bayeux'), 'priority' => 100, ) ); $wp_customize->add_setting( 'bayeux_blurb', array( 'default' => "This theme is the best thing since sliced bread!
And man do I know bread." ) ); $wp_customize->add_control( 'bayeux_blurb', array( 'label' => __( 'Blurb', 'bayeux' ), 'section' => 'bayeux_frontmatter', 'settings' => 'bayeux_blurb', ) ); $wp_customize->add_setting( 'bayeux_blurb_credit', array( 'default' => "Suzie Example, head of the Bread Council" ) ); $wp_customize->add_control( 'bayeux_blurb_credit', array( 'label' => __( 'Blurb credit', 'bayeux' ), 'section' => 'bayeux_frontmatter', 'settings' => 'bayeux_blurb_credit', ) ); // $wp_customize->add_setting( 'bayeux_title_page', array( // 'default' => "Suzie Example, head of the Bread Council" // ) ); // // $wp_customize->add_control( // new WP_Customize_Image_Control( // $wp_customize, // 'logo', // array( // 'label' => __( 'Title page image', 'bayeux' ), // 'section' => 'bayeux_frontmatter', // 'settings' => 'bayeux_title_page', // ) // ) // ); // damn this is tickling my DRY instincts. /* TODO: add controls for... - initial image x opening synopsys/quote/whatever - colors - page width colors: @bodytext: #60686F; @background: #231F20; @link: #a0a8aF; @visited-link: #80888F; @hover: #c0c8cF; */ } add_action( 'customize_register', 'bayeux_customize_register' ); function twentyfourteen_customize_register( $wp_customize ) { // 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 postMessage support for site title and description. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; // Rename the label to "Site Title Color" because this only affects the site title in this theme. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' ); // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', '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', 'sanitize_callback' => 'twentyfourteen_sanitize_layout', ) ); $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' ); /** * Sanitize the Featured Content layout value. * * @since Twenty Fourteen 1.0 * * @param string $layout Layout type. * @return string Filtered layout type (grid|slider). */ function twentyfourteen_sanitize_layout( $layout ) { if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) { $layout = 'grid'; } return $layout; } /** * 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' ), '20131205', 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' => '', ) ); } // add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' ); // add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' );