'ffffff', 'border' => 'e5e5e5', 'text' => '2b2b2b', 'link' => '24890d', 'url' => '24890d', ); } // Enable support for WP.com global print style. add_theme_support( 'print-style' ); } add_action( 'after_setup_theme', 'twentyfourteen_wpcom_setup' ); /** * De-queue Google fonts if custom fonts are being used instead. * * @return void */ function twentyfourteen_dequeue_fonts() { if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) && CustomDesign::is_upgrade_active() ) { $custom_fonts = TypekitData::get( 'families' ); if ( $custom_fonts && $custom_fonts['headings']['id'] && $custom_fonts['body-text']['id'] ) wp_dequeue_style( 'twentyfourteen-lato' ); } } add_action( 'wp_enqueue_scripts', 'twentyfourteen_dequeue_fonts' ); /** * Remove the widont filter because of the limited space for post/page title in the design. * * @return void */ function twentyfourteen_wido() { remove_filter( 'the_title', 'widont' ); } add_action( 'init', 'twentyfourteen_wido' ); /** * Enqueue our WP.com styles for front-end. * Loads after style.css so we can add overrides. */ function twentyfourteen_wpcom_styles() { wp_enqueue_style( 'twentyfourteen-wpcom-style', get_template_directory_uri() . '/css/style-wpcom.css', array( 'twentyfourteen-style' ), '20131112' ); if ( is_rtl() ) { wp_enqueue_style( 'twentyfourteen-wpcom-rtl-style', get_template_directory_uri() . '/css/style-wpcom-rtl.css', array( 'twentyfourteen-wpcom-style' ), '20131114' ); } } add_action( 'wp_enqueue_scripts', 'twentyfourteen_wpcom_styles' ); /** * A last try to show posts, in case the Featured Content plugin returns no IDs. * * @param array $featured_ids * @return array */ if ( !function_exists( 'twentyfourteen_featured_content_post_ids' ) ) { function twentyfourteen_featured_content_post_ids( $featured_ids ) { if ( empty( $featured_ids ) ) { $sticky_posts = get_option( 'sticky_posts', array() ); if ( is_array( $sticky_posts ) ) { $featured_ids = array_slice( $sticky_posts, 0, 6 ); } } return $featured_ids; } add_action( 'featured_content_post_ids', 'twentyfourteen_featured_content_post_ids' ); } /** * Set the default tag name for Featured Content. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. * @return void */ if ( !function_exists( 'twentyfourteen_customizer_default' ) ) { function twentyfourteen_customizer_default( $wp_customize ) { $wp_customize->get_setting( 'featured-content[tag-name]' )->default = 'featured'; } add_action( 'customize_register', 'twentyfourteen_customizer_default' ); } /** * Sets a default tag of 'featured' for Featured Content. * * @param array $settings * @return array */ if ( !function_exists( 'twentyfourteen_featured_content_default_settings' ) ) { function twentyfourteen_featured_content_default_settings( $settings ) { $settings['tag-name'] = 'featured'; $settings['quantity'] = 6; return $settings; } add_action( 'featured_content_default_settings', 'twentyfourteen_featured_content_default_settings' ); } /** * Removes sharing markup from post content if we're not in the loop and it's a * formatted post. * * @param bool $show Whether to show sharing options. * @param WP_Post $post The post to share. * @return bool */ if ( !function_exists( 'twentyfourteen_mute_content_filters' ) ) { function twentyfourteen_mute_content_filters( $show, $post ) { $formats = get_theme_support( 'post-formats' ); if ( ! in_the_loop() && has_post_format( $formats[0], $post ) ) { $show = false; } return $show; } add_filter( 'sharing_show', 'twentyfourteen_mute_content_filters', 10, 2 ); } /** * Override Featured Content quantity option. * * Since Twenty Fourteen doesn't use the quantity option (instead it goes * "up to 6" based on posts tagged or sticky posts), ignore the quantity * option set by the Jetpack Featured Content plugin. * * @return void */ function twentyfourteen_override_featured_quantity() { $option = (array) get_option( 'featured-content' ); if ( isset( $option['quantity'] ) && 5 === $option['quantity'] ) { $option['quantity'] = 6; update_option( 'featured-content', $option ); } } add_action( 'admin_init', 'twentyfourteen_override_featured_quantity' );