'ffffff', 'border' => 'c3c0ab', 'text' => '141412', 'link' => 'f24b12', 'url' => 'f24b12', ); } /** * De-queue Google fonts if custom fonts are being used. * * @return void */ function twentythirteen_wpcom_fonts() { if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) ) { if ( CustomDesign::is_upgrade_active() ) { $customfonts = TypekitData::get( 'families' ); if ( $customfonts && $customfonts['site-title']['id'] && $customfonts['headings']['id'] && $customfonts['body-text']['id'] ) wp_dequeue_style( 'twentythirteen-fonts' ); } } } add_action( 'wp_enqueue_scripts', 'twentythirteen_wpcom_fonts' ); /** * Enqueue our WP.com styles for front-end. * Loads after style.css so we can add overrides. */ function twentythirteen_wpcom_styles() { wp_enqueue_style( 'twentythirteen-wpcom-style', get_template_directory_uri() . '/css/style-wpcom.css', array( 'twentythirteen-style' ), '2013-07-22' ); if ( is_rtl() ) { wp_enqueue_style( 'twentythirteen-wpcom-rtl-style', get_template_directory_uri() . '/css/style-wpcom-rtl.css', array( 'twentythirteen-style', 'twentythirteen-wpcom-style' ), '2013-07-22' ); } } add_action( 'wp_enqueue_scripts', 'twentythirteen_wpcom_styles' ); /** * Adjusts content_width value for youtube videos in video post formats. * * @param int YouTube video width. * @return int Filtered YouTube video width. */ function twentythirteen_wpcom_youtube_video_width( $width ) { if ( has_post_format( 'video' ) ) $width = 724; return $width; } add_filter( 'youtube_width', 'twentythirteen_wpcom_youtube_video_width' ); /** * Adjusts the height value for youtube videos in video post formats. * * @param int YouTube video height. * @return int Filtered YouTube video height. */ function twentythirteen_wpcom_youtube_video_height( $height ) { if ( has_post_format( 'video' ) ) $height = 437; // Educated guess: 16:9. return $height; } add_filter( 'youtube_height', 'twentythirteen_wpcom_youtube_video_height' ); // @TODO: Vimeo /** * Gets a medium size image instead of thumbnail when embedding images from * Instagram with an embed or bare URL. * This currently fails because Instagram's minimum size for medium is 612, * and Twenty Thirteen has 604 set as content_width. * * @param string Provider. * @param string Embedded URL. * @param array Passed arguments for this oEmbed provider. * @return string If Instagram isn't the provider or if image is smaller than * required, or function call add_query_arg() to override maxwidth in the API * call to get the medium size image. */ function twentythirteen_wpcom_instagram_oembed( $provider, $url, $args ) { if ( 0 !== strpos( $provider, 'http://api.instagram.com/oembed' ) && $args['width'] < 612 ) return $provider; return add_query_arg( 'maxwidth', 612, $provider ); } add_filter( 'oembed_fetch_url', 'twentythirteen_wpcom_instagram_oembed', 10, 3 ); /** * Registers a custom image sizes for gallery post formats, to be used on the * index/search/archive views to show a larger thumbnail for the first image * in the grid layout. * * @return void */ function twentythirteen_wpcom_gallery_image_size() { add_image_size( 'twentythirteen-gallery-post', 300, 300, true ); } add_action( 'after_setup_theme', 'twentythirteen_wpcom_gallery_image_size' ); /** * Sets the image size in featured galleries to large. * This was dropped from core theme in * * @param array $atts Combined and filtered attribute list. * @return array The filtered attribute list. */ function twentythirteen_wpcom_gallery_atts( $atts ) { if ( has_post_format( 'gallery' ) && ! is_single() ) $atts['size'] = wp_is_mobile() ? 'thumbnail' : 'twentythirteen-gallery-post'; return $atts; } add_filter( 'shortcode_atts_gallery', 'twentythirteen_wpcom_gallery_atts' ); /** * Add theme support for Responsive Videos for WP.com */ function twentythirteen_responsive_videos_init() { add_theme_support( 'jetpack-responsive-videos' ); } add_action( 'after_setup_theme', 'twentythirteen_responsive_videos_init' );