From 302b760bd00e82d9f5a8cef4ba821c1759a6601b Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Fri, 8 Jun 2018 10:05:32 -0400 Subject: Update twentyfourteen 2.2 --- themes/twentyfourteen/archive.php | 19 +- themes/twentyfourteen/author.php | 15 +- themes/twentyfourteen/category.php | 21 +- themes/twentyfourteen/comments.php | 46 +-- themes/twentyfourteen/content-aside.php | 30 +- themes/twentyfourteen/content-audio.php | 30 +- themes/twentyfourteen/content-featured-post.php | 14 +- themes/twentyfourteen/content-gallery.php | 30 +- themes/twentyfourteen/content-image.php | 30 +- themes/twentyfourteen/content-link.php | 30 +- themes/twentyfourteen/content-page.php | 14 +- themes/twentyfourteen/content-quote.php | 30 +- themes/twentyfourteen/content-video.php | 30 +- themes/twentyfourteen/content.php | 35 +- themes/twentyfourteen/featured-content.php | 8 +- themes/twentyfourteen/footer.php | 11 +- themes/twentyfourteen/functions.php | 389 +++++++++++---------- themes/twentyfourteen/header.php | 10 +- themes/twentyfourteen/image.php | 49 +-- themes/twentyfourteen/inc/back-compat.php | 8 +- themes/twentyfourteen/inc/custom-header.php | 96 ++--- themes/twentyfourteen/inc/customizer.php | 105 +++--- themes/twentyfourteen/inc/featured-content.php | 161 ++++----- themes/twentyfourteen/inc/template-tags.php | 269 +++++++------- themes/twentyfourteen/inc/widgets.php | 151 ++++---- themes/twentyfourteen/index.php | 33 +- themes/twentyfourteen/js/functions.js | 3 +- .../twentyfourteen/page-templates/contributors.php | 31 +- .../twentyfourteen/page-templates/full-width.php | 23 +- themes/twentyfourteen/page.php | 23 +- themes/twentyfourteen/readme.txt | 9 +- themes/twentyfourteen/rtl.css | 13 +- themes/twentyfourteen/search.php | 17 +- themes/twentyfourteen/sidebar.php | 2 +- themes/twentyfourteen/single.php | 27 +- themes/twentyfourteen/style.css | 16 +- themes/twentyfourteen/tag.php | 21 +- themes/twentyfourteen/taxonomy-post_format.php | 21 +- 38 files changed, 1007 insertions(+), 863 deletions(-) (limited to 'themes/twentyfourteen') diff --git a/themes/twentyfourteen/archive.php b/themes/twentyfourteen/archive.php index 6a4deed0..e2b4b414 100644 --- a/themes/twentyfourteen/archive.php +++ b/themes/twentyfourteen/archive.php @@ -27,8 +27,8 @@ get_header(); ?> @@ -55,11 +55,13 @@ if ( post_password_required() ) {
    'ol', - 'short_ping' => true, - 'avatar_size' => 34, - ) ); + wp_list_comments( + array( + 'style' => 'ol', + 'short_ping' => true, + 'avatar_size' => 34, + ) + ); ?>
diff --git a/themes/twentyfourteen/content-aside.php b/themes/twentyfourteen/content-aside.php index 0401579d..554416df 100644 --- a/themes/twentyfourteen/content-aside.php +++ b/themes/twentyfourteen/content-aside.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-audio.php b/themes/twentyfourteen/content-audio.php index 9fa9df41..8fc2095a 100644 --- a/themes/twentyfourteen/content-audio.php +++ b/themes/twentyfourteen/content-audio.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-featured-post.php b/themes/twentyfourteen/content-featured-post.php index 6cc88224..d5a16fef 100644 --- a/themes/twentyfourteen/content-featured-post.php +++ b/themes/twentyfourteen/content-featured-post.php @@ -12,12 +12,12 @@ @@ -29,6 +29,6 @@ - ','' ); ?> + ', '' ); ?> diff --git a/themes/twentyfourteen/content-gallery.php b/themes/twentyfourteen/content-gallery.php index 6e3fe832..db382fef 100644 --- a/themes/twentyfourteen/content-gallery.php +++ b/themes/twentyfourteen/content-gallery.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-image.php b/themes/twentyfourteen/content-image.php index a81e493d..11aa1e8f 100644 --- a/themes/twentyfourteen/content-image.php +++ b/themes/twentyfourteen/content-image.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-link.php b/themes/twentyfourteen/content-link.php index 858301ef..5c979863 100644 --- a/themes/twentyfourteen/content-link.php +++ b/themes/twentyfourteen/content-link.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-page.php b/themes/twentyfourteen/content-page.php index 98394190..6a33baa7 100644 --- a/themes/twentyfourteen/content-page.php +++ b/themes/twentyfourteen/content-page.php @@ -18,12 +18,14 @@
'', - 'link_before' => '', - 'link_after' => '', - ) ); + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); edit_post_link( __( 'Edit', 'twentyfourteen' ), '', '' ); ?> diff --git a/themes/twentyfourteen/content-quote.php b/themes/twentyfourteen/content-quote.php index 10a5d112..fa0b8992 100644 --- a/themes/twentyfourteen/content-quote.php +++ b/themes/twentyfourteen/content-quote.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content-video.php b/themes/twentyfourteen/content-video.php index 4c49aaa1..951a13cf 100644 --- a/themes/twentyfourteen/content-video.php +++ b/themes/twentyfourteen/content-video.php @@ -19,8 +19,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -44,17 +44,21 @@
→', 'twentyfourteen' ), - the_title( '', '', false ) - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - ) ); + the_content( + sprintf( + __( 'Continue reading %s ', 'twentyfourteen' ), + the_title( '', '', false ) + ) + ); + + wp_link_pages( + array( + 'before' => '', + 'link_before' => '', + 'link_after' => '', + ) + ); ?>
diff --git a/themes/twentyfourteen/content.php b/themes/twentyfourteen/content.php index e571d8b3..03eb3e89 100644 --- a/themes/twentyfourteen/content.php +++ b/themes/twentyfourteen/content.php @@ -21,8 +21,8 @@ ', '' ); +if ( is_single() ) : + the_title( '

', '

' ); else : the_title( '

', '

' ); endif; @@ -30,10 +30,11 @@ diff --git a/themes/twentyfourteen/featured-content.php b/themes/twentyfourteen/featured-content.php index c56edf3e..f9f32dd3 100644 --- a/themes/twentyfourteen/featured-content.php +++ b/themes/twentyfourteen/featured-content.php @@ -19,11 +19,11 @@ do_action( 'twentyfourteen_featured_posts_before' ); $featured_posts = twentyfourteen_get_featured_posts(); - foreach ( (array) $featured_posts as $order => $post ) : - setup_postdata( $post ); + foreach ( (array) $featured_posts as $order => $post ) : + setup_postdata( $post ); - // Include the featured content template. - get_template_part( 'content', 'featured-post' ); + // Include the featured content template. + get_template_part( 'content', 'featured-post' ); endforeach; /** diff --git a/themes/twentyfourteen/footer.php b/themes/twentyfourteen/footer.php index 519e1288..d1016eb9 100644 --- a/themes/twentyfourteen/footer.php +++ b/themes/twentyfourteen/footer.php @@ -18,11 +18,18 @@
- + ' ); + } + ?> + + +
- \ No newline at end of file + diff --git a/themes/twentyfourteen/functions.php b/themes/twentyfourteen/functions.php index 2946d19d..49deb790 100644 --- a/themes/twentyfourteen/functions.php +++ b/themes/twentyfourteen/functions.php @@ -44,79 +44,101 @@ if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { } if ( ! function_exists( 'twentyfourteen_setup' ) ) : -/** - * Twenty Fourteen setup. - * - * Set up theme defaults and registers support for various WordPress features. - * - * Note that this function is hooked into the after_setup_theme hook, which - * runs before the init hook. The init hook is too late for some features, such - * as indicating support post thumbnails. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_setup() { - - /* - * Make Twenty Fourteen available for translation. + /** + * Twenty Fourteen setup. + * + * Set up theme defaults and registers support for various WordPress features. * - * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen - * If you're building a theme based on Twenty Fourteen, use a find and - * replace to change 'twentyfourteen' to the name of your theme in all - * template files. + * Note that this function is hooked into the after_setup_theme hook, which + * runs before the init hook. The init hook is too late for some features, such + * as indicating support post thumbnails. + * + * @since Twenty Fourteen 1.0 */ - load_theme_textdomain( 'twentyfourteen' ); + function twentyfourteen_setup() { + + /* + * Make Twenty Fourteen available for translation. + * + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfourteen + * If you're building a theme based on Twenty Fourteen, use a find and + * replace to change 'twentyfourteen' to the name of your theme in all + * template files. + */ + load_theme_textdomain( 'twentyfourteen' ); + + // This theme styles the visual editor to resemble the theme style. + add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); + + // Add RSS feed links to for posts and comments. + add_theme_support( 'automatic-feed-links' ); + + // Enable support for Post Thumbnails, and declare two sizes. + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 672, 372, true ); + add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); + + // This theme uses wp_nav_menu() in two locations. + register_nav_menus( + array( + 'primary' => __( 'Top primary menu', 'twentyfourteen' ), + 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), + ) + ); - // This theme styles the visual editor to resemble the theme style. - add_editor_style( array( 'css/editor-style.css', twentyfourteen_font_url(), 'genericons/genericons.css' ) ); + /* + * Switch default core markup for search form, comment form, and comments + * to output valid HTML5. + */ + add_theme_support( + 'html5', array( + 'search-form', + 'comment-form', + 'comment-list', + 'gallery', + 'caption', + ) + ); - // Add RSS feed links to for posts and comments. - add_theme_support( 'automatic-feed-links' ); + /* + * Enable support for Post Formats. + * See https://codex.wordpress.org/Post_Formats + */ + add_theme_support( + 'post-formats', array( + 'aside', + 'image', + 'video', + 'audio', + 'quote', + 'link', + 'gallery', + ) + ); - // Enable support for Post Thumbnails, and declare two sizes. - add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 672, 372, true ); - add_image_size( 'twentyfourteen-full-width', 1038, 576, true ); + // This theme allows users to set a custom background. + add_theme_support( + 'custom-background', apply_filters( + 'twentyfourteen_custom_background_args', array( + 'default-color' => 'f5f5f5', + ) + ) + ); - // This theme uses wp_nav_menu() in two locations. - register_nav_menus( array( - 'primary' => __( 'Top primary menu', 'twentyfourteen' ), - 'secondary' => __( 'Secondary menu in left sidebar', 'twentyfourteen' ), - ) ); + // Add support for featured content. + add_theme_support( + 'featured-content', array( + 'featured_content_filter' => 'twentyfourteen_get_featured_posts', + 'max_posts' => 6, + ) + ); - /* - * Switch default core markup for search form, comment form, and comments - * to output valid HTML5. - */ - add_theme_support( 'html5', array( - 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' - ) ); + // This theme uses its own gallery styles. + add_filter( 'use_default_gallery_style', '__return_false' ); - /* - * Enable support for Post Formats. - * See https://codex.wordpress.org/Post_Formats - */ - add_theme_support( 'post-formats', array( - 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery', - ) ); - - // This theme allows users to set a custom background. - add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array( - 'default-color' => 'f5f5f5', - ) ) ); - - // Add support for featured content. - add_theme_support( 'featured-content', array( - 'featured_content_filter' => 'twentyfourteen_get_featured_posts', - 'max_posts' => 6, - ) ); - - // This theme uses its own gallery styles. - add_filter( 'use_default_gallery_style', '__return_false' ); - - // Indicate widget sidebars can use selective refresh in the Customizer. - add_theme_support( 'customize-selective-refresh-widgets' ); -} + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); + } endif; // twentyfourteen_setup add_action( 'after_setup_theme', 'twentyfourteen_setup' ); @@ -170,33 +192,39 @@ function twentyfourteen_widgets_init() { require get_template_directory() . '/inc/widgets.php'; register_widget( 'Twenty_Fourteen_Ephemera_Widget' ); - register_sidebar( array( - 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), - 'id' => 'sidebar-1', - 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); - register_sidebar( array( - 'name' => __( 'Content Sidebar', 'twentyfourteen' ), - 'id' => 'sidebar-2', - 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); - register_sidebar( array( - 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), - 'id' => 'sidebar-3', - 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - ) ); + register_sidebar( + array( + 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-1', + 'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) + ); + register_sidebar( + array( + 'name' => __( 'Content Sidebar', 'twentyfourteen' ), + 'id' => 'sidebar-2', + 'description' => __( 'Additional sidebar that appears on the right.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) + ); + register_sidebar( + array( + 'name' => __( 'Footer Widget Area', 'twentyfourteen' ), + 'id' => 'sidebar-3', + 'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ), + 'before_widget' => '', + 'before_title' => '

', + 'after_title' => '

', + ) + ); } add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); @@ -218,7 +246,7 @@ function twentyfourteen_font_url() { 'family' => urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), 'subset' => urlencode( 'latin,latin-ext' ), ); - $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); + $font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return $font_url; @@ -257,10 +285,12 @@ function twentyfourteen_scripts() { if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); - wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( - 'prevText' => __( 'Previous', 'twentyfourteen' ), - 'nextText' => __( 'Next', 'twentyfourteen' ) - ) ); + wp_localize_script( + 'twentyfourteen-slider', 'featuredSliderDefaults', array( + 'prevText' => __( 'Previous', 'twentyfourteen' ), + 'nextText' => __( 'Next', 'twentyfourteen' ), + ) + ); } wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150315', true ); @@ -303,96 +333,99 @@ function twentyfourteen_resource_hints( $urls, $relation_type ) { add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : -/** - * Print the attached image with a link to the next attached image. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_the_attached_image() { - $post = get_post(); /** - * Filter the default Twenty Fourteen attachment size. + * Print the attached image with a link to the next attached image. * * @since Twenty Fourteen 1.0 - * - * @param array $dimensions { - * An array of height and width dimensions. - * - * @type int $height Height of the image in pixels. Default 810. - * @type int $width Width of the image in pixels. Default 810. - * } */ - $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); - $next_attachment_url = wp_get_attachment_url(); + function twentyfourteen_the_attached_image() { + $post = get_post(); + /** + * Filter the default Twenty Fourteen attachment size. + * + * @since Twenty Fourteen 1.0 + * + * @param array $dimensions { + * An array of height and width dimensions. + * + * @type int $height Height of the image in pixels. Default 810. + * @type int $width Width of the image in pixels. Default 810. + * } + */ + $attachment_size = apply_filters( 'twentyfourteen_attachment_size', array( 810, 810 ) ); + $next_attachment_url = wp_get_attachment_url(); + + /* + * Grab the IDs of all the image attachments in a gallery so we can get the URL + * of the next adjacent image in a gallery, or the first image (if we're + * looking at the last image in a gallery), or, in a gallery of one, just the + * link to that image file. + */ + $attachment_ids = get_posts( + array( + 'post_parent' => $post->post_parent, + 'fields' => 'ids', + 'numberposts' => -1, + 'post_status' => 'inherit', + 'post_type' => 'attachment', + 'post_mime_type' => 'image', + 'order' => 'ASC', + 'orderby' => 'menu_order ID', + ) + ); - /* - * Grab the IDs of all the image attachments in a gallery so we can get the URL - * of the next adjacent image in a gallery, or the first image (if we're - * looking at the last image in a gallery), or, in a gallery of one, just the - * link to that image file. - */ - $attachment_ids = get_posts( array( - 'post_parent' => $post->post_parent, - 'fields' => 'ids', - 'numberposts' => -1, - 'post_status' => 'inherit', - 'post_type' => 'attachment', - 'post_mime_type' => 'image', - 'order' => 'ASC', - 'orderby' => 'menu_order ID', - ) ); - - // If there is more than 1 attachment in a gallery... - if ( count( $attachment_ids ) > 1 ) { - foreach ( $attachment_ids as $idx => $attachment_id ) { - if ( $attachment_id == $post->ID ) { - $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; - break; + // If there is more than 1 attachment in a gallery... + if ( count( $attachment_ids ) > 1 ) { + foreach ( $attachment_ids as $idx => $attachment_id ) { + if ( $attachment_id == $post->ID ) { + $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ]; + break; + } } - } - // get the URL of the next image attachment... - if ( $next_id ) { - $next_attachment_url = get_attachment_link( $next_id ); + // get the URL of the next image attachment... + if ( $next_id ) { + $next_attachment_url = get_attachment_link( $next_id ); + } // or get the URL of the first image attachment. + else { + $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); + } } - // or get the URL of the first image attachment. - else { - $next_attachment_url = get_attachment_link( reset( $attachment_ids ) ); - } + printf( + '%2$s', + esc_url( $next_attachment_url ), + wp_get_attachment_image( $post->ID, $attachment_size ) + ); } - - printf( '%2$s', - esc_url( $next_attachment_url ), - wp_get_attachment_image( $post->ID, $attachment_size ) - ); -} endif; if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : -/** - * Print a list of all site contributors who published at least one post. - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_list_authors() { - $contributor_ids = get_users( array( - 'fields' => 'ID', - 'orderby' => 'post_count', - 'order' => 'DESC', - 'who' => 'authors', - ) ); - - foreach ( $contributor_ids as $contributor_id ) : - $post_count = count_user_posts( $contributor_id ); - - // Move on if user has not published a post (yet). - if ( ! $post_count ) { - continue; - } - ?> + /** + * Print a list of all site contributors who published at least one post. + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_list_authors() { + $contributor_ids = get_users( + array( + 'fields' => 'ID', + 'orderby' => 'post_count', + 'order' => 'DESC', + 'who' => 'authors', + ) + ); -
+ foreach ( $contributor_ids as $contributor_id ) : + $post_count = count_user_posts( $contributor_id ); + + // Move on if user has not published a post (yet). + if ( ! $post_count ) { + continue; + } + ?> + +
@@ -409,7 +442,7 @@ function twentyfourteen_list_authors() { is_preview(); -} + return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview(); + } endif; diff --git a/themes/twentyfourteen/header.php b/themes/twentyfourteen/header.php index 7286d889..4dec164a 100644 --- a/themes/twentyfourteen/header.php +++ b/themes/twentyfourteen/header.php @@ -51,7 +51,15 @@
diff --git a/themes/twentyfourteen/image.php b/themes/twentyfourteen/image.php index 83ac67f6..999800fa 100644 --- a/themes/twentyfourteen/image.php +++ b/themes/twentyfourteen/image.php @@ -18,45 +18,48 @@ get_header(); -
+ -
-
-
- -
+
+
+
+ +
- +
-
+
- '', 'link_before' => '', 'link_after' => '', - ) ); - ?> + ) + ); + ?>
diff --git a/themes/twentyfourteen/inc/back-compat.php b/themes/twentyfourteen/inc/back-compat.php index c184d912..3943aeef 100644 --- a/themes/twentyfourteen/inc/back-compat.php +++ b/themes/twentyfourteen/inc/back-compat.php @@ -44,9 +44,11 @@ function twentyfourteen_upgrade_notice() { * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize() { - wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array( - 'back_link' => true, - ) ); + wp_die( + sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), '', array( + 'back_link' => true, + ) + ); } add_action( 'load-customize.php', 'twentyfourteen_customize' ); diff --git a/themes/twentyfourteen/inc/custom-header.php b/themes/twentyfourteen/inc/custom-header.php index 287b1068..bfea8976 100644 --- a/themes/twentyfourteen/inc/custom-header.php +++ b/themes/twentyfourteen/inc/custom-header.php @@ -35,36 +35,40 @@ function twentyfourteen_custom_header_setup() { * the Appearance > Header screen. * } */ - add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( - 'default-text-color' => 'fff', - 'width' => 1260, - 'height' => 240, - 'flex-height' => true, - 'wp-head-callback' => 'twentyfourteen_header_style', - 'admin-head-callback' => 'twentyfourteen_admin_header_style', - 'admin-preview-callback' => 'twentyfourteen_admin_header_image', - ) ) ); + add_theme_support( + 'custom-header', apply_filters( + 'twentyfourteen_custom_header_args', array( + 'default-text-color' => 'fff', + 'width' => 1260, + 'height' => 240, + 'flex-height' => true, + 'wp-head-callback' => 'twentyfourteen_header_style', + 'admin-head-callback' => 'twentyfourteen_admin_header_style', + 'admin-preview-callback' => 'twentyfourteen_admin_header_image', + ) + ) + ); } add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); if ( ! function_exists( 'twentyfourteen_header_style' ) ) : -/** - * Styles the header image and text displayed on the blog - * - * @see twentyfourteen_custom_header_setup(). - * - */ -function twentyfourteen_header_style() { - $text_color = get_header_textcolor(); + /** + * Styles the header image and text displayed on the blog + * + * @see twentyfourteen_custom_header_setup(). + */ + function twentyfourteen_header_style() { + $text_color = get_header_textcolor(); - // If no custom color for text is set, let's bail. - if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) - return; + // If no custom color for text is set, let's bail. + if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { + return; + } - // If we get this far, we have custom styles. - ?> - Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_admin_header_style() { -?> + /** + * Style the header image displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_admin_header_style() { + ?> - Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ -function twentyfourteen_admin_header_image() { -?> + /** + * Create the custom header image markup displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_admin_header_image() { + ?>
@@ -143,5 +147,5 @@ function twentyfourteen_admin_header_image() {

get_setting( 'blogname' )->transport = 'postMessage'; - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; + $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; + $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { - $wp_customize->selective_refresh->add_partial( 'blogname', array( - 'selector' => '.site-title a', - 'container_inclusive' => false, - 'render_callback' => 'twentyfourteen_customize_partial_blogname', - ) ); - $wp_customize->selective_refresh->add_partial( 'blogdescription', array( - 'selector' => '.site-description', - 'container_inclusive' => false, - 'render_callback' => 'twentyfourteen_customize_partial_blogdescription', - ) ); + $wp_customize->selective_refresh->add_partial( + 'blogname', array( + 'selector' => '.site-title a', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogname', + ) + ); + $wp_customize->selective_refresh->add_partial( + 'blogdescription', array( + 'selector' => '.site-description', + 'container_inclusive' => false, + 'render_callback' => 'twentyfourteen_customize_partial_blogdescription', + ) + ); } // Rename the label to "Site Title Color" because this only affects the site title in this theme. @@ -49,31 +53,38 @@ function twentyfourteen_customize_register( $wp_customize ) { } // 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' ), - esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), - admin_url( 'edit.php?show_sticky=1' ) - ), - 'priority' => 130, - 'active_callback' => 'is_front_page', - ) ); + $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' ), + esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), + admin_url( 'edit.php?show_sticky=1' ) + ), + 'priority' => 130, + 'active_callback' => 'is_front_page', + ) + ); // 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_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' ), - ), - ) ); + $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' ); @@ -137,16 +148,18 @@ function twentyfourteen_contextual_help() { return; } - get_current_screen()->add_help_tab( array( - 'id' => 'twentyfourteen', - 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), - 'content' => - '
    ' . - '
  • ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
  • ' . - '
  • ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
  • ' . - '
  • ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Twenty Fourteen documentation.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '
  • ' . - '
', - ) ); + get_current_screen()->add_help_tab( + array( + 'id' => 'twentyfourteen', + 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), + 'content' => + '
    ' . + '
  • ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
  • ' . + '
  • ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
  • ' . + '
  • ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Twenty Fourteen documentation.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '
  • ' . + '
', + ) + ); } add_action( 'admin_head-themes.php', 'twentyfourteen_contextual_help' ); -add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' ); +add_action( 'admin_head-edit.php', 'twentyfourteen_contextual_help' ); diff --git a/themes/twentyfourteen/inc/featured-content.php b/themes/twentyfourteen/inc/featured-content.php index ffeb993d..808a8a74 100644 --- a/themes/twentyfourteen/inc/featured-content.php +++ b/themes/twentyfourteen/inc/featured-content.php @@ -23,8 +23,6 @@ class Featured_Content { * * @since Twenty Fourteen 1.0 * - * @static - * @access public * @var int */ public static $max_posts = 15; @@ -34,8 +32,6 @@ class Featured_Content { * * All custom functionality will be hooked into the "init" action. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function setup() { @@ -51,8 +47,6 @@ class Featured_Content { * If no theme support is found there is no need to hook into WordPress. * We'll just return early instead. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function init() { @@ -83,15 +77,15 @@ class Featured_Content { self::$max_posts = absint( $theme_support[0]['max_posts'] ); } - add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); - add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); - add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); - add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); - add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); - add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); - add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); - add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); - add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); + add_filter( $filter, array( __CLASS__, 'get_featured_posts' ) ); + add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 ); + add_action( 'admin_init', array( __CLASS__, 'register_setting' ) ); + add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) ); + add_action( 'save_post', array( __CLASS__, 'delete_transient' ) ); + add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) ); + add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) ); + add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); + add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) ); } /** @@ -100,13 +94,11 @@ class Featured_Content { * Has to run on wp_loaded so that the preview filters of the Customizer * have a chance to alter the value. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function wp_loaded() { if ( self::get_setting( 'hide-tag' ) ) { - add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); + add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 ); } } @@ -114,8 +106,6 @@ class Featured_Content { /** * Get featured posts. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @return array Array of featured posts. @@ -128,10 +118,12 @@ class Featured_Content { return array(); } - $featured_posts = get_posts( array( - 'include' => $post_ids, - 'posts_per_page' => count( $post_ids ), - ) ); + $featured_posts = get_posts( + array( + 'include' => $post_ids, + 'posts_per_page' => count( $post_ids ), + ) + ); return $featured_posts; } @@ -144,8 +136,6 @@ class Featured_Content { * * Sets the "featured_content_ids" transient. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @return array Array of post IDs. @@ -160,18 +150,20 @@ class Featured_Content { if ( $term ) { // Query for featured posts. - $featured_ids = get_posts( array( - 'fields' => 'ids', - 'numberposts' => self::$max_posts, - 'suppress_filters' => false, - 'tax_query' => array( - array( - 'field' => 'term_id', - 'taxonomy' => 'post_tag', - 'terms' => $term->term_id, + $featured_ids = get_posts( + array( + 'fields' => 'ids', + 'numberposts' => self::$max_posts, + 'suppress_filters' => false, + 'tax_query' => array( + array( + 'field' => 'term_id', + 'taxonomy' => 'post_tag', + 'terms' => $term->term_id, + ), ), - ), - ) ); + ) + ); } // Get sticky posts if no Featured Content exists. @@ -189,8 +181,6 @@ class Featured_Content { /** * Return an array with IDs of posts maked as sticky. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @return array Array of sticky posts. @@ -206,8 +196,6 @@ class Featured_Content { * * @see Featured_Content::validate_settings(). * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function delete_transient() { @@ -221,8 +209,6 @@ class Featured_Content { * Hooked onto the 'pre_get_posts' action, this changes the parameters of * the query before it gets any posts. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param WP_Query $query WP_Query object. @@ -269,8 +255,6 @@ class Featured_Content { * * @see Featured_Content::validate_settings(). * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param int $tag_id The term_id of the tag that has been deleted. @@ -283,7 +267,7 @@ class Featured_Content { } $settings['tag-id'] = 0; - $settings = self::validate_settings( $settings ); + $settings = self::validate_settings( $settings ); update_option( 'featured-content', $settings ); } @@ -292,8 +276,6 @@ class Featured_Content { * * Hooks into the "get_terms" filter. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param array $terms List of term objects. This is the return value of get_terms(). @@ -340,8 +322,6 @@ class Featured_Content { * * Hooks into the "get_the_terms" filter. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param array $terms A list of term objects. This is the return value of get_the_terms(). @@ -381,8 +361,6 @@ class Featured_Content { /** * Register custom setting on the Settings -> Reading screen. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function register_setting() { @@ -392,54 +370,61 @@ class Featured_Content { /** * Add settings to the Customizer. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param WP_Customize_Manager $wp_customize Customizer object. */ public static function customize_register( $wp_customize ) { - $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' ), - esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), - admin_url( 'edit.php?show_sticky=1' ) - ), - 'priority' => 130, - 'theme_supports' => 'featured-content', - ) ); + $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' ), + esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), + admin_url( 'edit.php?show_sticky=1' ) + ), + 'priority' => 130, + 'theme_supports' => 'featured-content', + ) + ); // Add Featured Content settings. - $wp_customize->add_setting( 'featured-content[tag-name]', array( - 'default' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), - 'type' => 'option', - 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), - ) ); - $wp_customize->add_setting( 'featured-content[hide-tag]', array( - 'default' => true, - 'type' => 'option', - 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), - ) ); + $wp_customize->add_setting( + 'featured-content[tag-name]', array( + 'default' => _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), + 'type' => 'option', + 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), + ) + ); + $wp_customize->add_setting( + 'featured-content[hide-tag]', array( + 'default' => true, + 'type' => 'option', + 'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ), + ) + ); // Add Featured Content controls. - $wp_customize->add_control( 'featured-content[tag-name]', array( - 'label' => __( 'Tag Name', 'twentyfourteen' ), - 'section' => 'featured_content', - 'priority' => 20, - ) ); - $wp_customize->add_control( 'featured-content[hide-tag]', array( - 'label' => __( 'Don’t display tag on front end.', 'twentyfourteen' ), - 'section' => 'featured_content', - 'type' => 'checkbox', - 'priority' => 30, - ) ); + $wp_customize->add_control( + 'featured-content[tag-name]', array( + 'label' => __( 'Tag Name', 'twentyfourteen' ), + 'section' => 'featured_content', + 'priority' => 20, + ) + ); + $wp_customize->add_control( + 'featured-content[hide-tag]', array( + 'label' => __( 'Don’t display tag on front end.', 'twentyfourteen' ), + 'section' => 'featured_content', + 'type' => 'checkbox', + 'priority' => 30, + ) + ); } /** * Enqueue the tag suggestion script. * - * @static - * @access public * @since Twenty Fourteen 1.0 */ public static function enqueue_scripts() { @@ -458,8 +443,6 @@ class Featured_Content { * its name as the first parameter to the function and only that * value will be returned. * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param string $key The key of a recognized setting. @@ -491,8 +474,6 @@ class Featured_Content { * format before saving to the database. This function will also * delete the transient set in Featured_Content::get_featured_content(). * - * @static - * @access public * @since Twenty Fourteen 1.0 * * @param array $input Array of settings input. diff --git a/themes/twentyfourteen/inc/template-tags.php b/themes/twentyfourteen/inc/template-tags.php index 1d35d0d5..89393316 100644 --- a/themes/twentyfourteen/inc/template-tags.php +++ b/themes/twentyfourteen/inc/template-tags.php @@ -8,53 +8,55 @@ */ if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) : -/** - * Display navigation to next/previous set of posts when applicable. - * - * @since Twenty Fourteen 1.0 - * - * @global WP_Query $wp_query WordPress Query object. - * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. - */ -function twentyfourteen_paging_nav() { - global $wp_query, $wp_rewrite; - - // Don't print empty markup if there's only one page. - if ( $wp_query->max_num_pages < 2 ) { - return; - } - - $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; - $pagenum_link = html_entity_decode( get_pagenum_link() ); - $query_args = array(); - $url_parts = explode( '?', $pagenum_link ); - - if ( isset( $url_parts[1] ) ) { - wp_parse_str( $url_parts[1], $query_args ); - } + /** + * Display navigation to next/previous set of posts when applicable. + * + * @since Twenty Fourteen 1.0 + * + * @global WP_Query $wp_query WordPress Query object. + * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. + */ + function twentyfourteen_paging_nav() { + global $wp_query, $wp_rewrite; + + // Don't print empty markup if there's only one page. + if ( $wp_query->max_num_pages < 2 ) { + return; + } - $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); - $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; + $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; + $pagenum_link = html_entity_decode( get_pagenum_link() ); + $query_args = array(); + $url_parts = explode( '?', $pagenum_link ); - $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; - $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; + if ( isset( $url_parts[1] ) ) { + wp_parse_str( $url_parts[1], $query_args ); + } - // Set up paginated links. - $links = paginate_links( array( - 'base' => $pagenum_link, - 'format' => $format, - 'total' => $wp_query->max_num_pages, - 'current' => $paged, - 'mid_size' => 1, - 'add_args' => array_map( 'urlencode', $query_args ), - 'prev_text' => __( '← Previous', 'twentyfourteen' ), - 'next_text' => __( 'Next →', 'twentyfourteen' ), - ) ); + $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); + $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; + + $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; + $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; + + // Set up paginated links. + $links = paginate_links( + array( + 'base' => $pagenum_link, + 'format' => $format, + 'total' => $wp_query->max_num_pages, + 'current' => $paged, + 'mid_size' => 1, + 'add_args' => array_map( 'urlencode', $query_args ), + 'prev_text' => __( '← Previous', 'twentyfourteen' ), + 'next_text' => __( 'Next →', 'twentyfourteen' ), + ) + ); - if ( $links ) : + if ( $links ) : - ?> -
+ + ' . __( 'Sticky', 'twentyfourteen' ) . ''; - } + /** + * Print HTML with meta information for the current post-date/time and author. + * + * @since Twenty Fourteen 1.0 + */ + function twentyfourteen_posted_on() { + if ( is_sticky() && is_home() && ! is_paged() ) { + echo '' . __( 'Sticky', 'twentyfourteen' ) . ''; + } - // Set up and print post meta information. - printf( ' ', - esc_url( get_permalink() ), - esc_attr( get_the_date( 'c' ) ), - esc_html( get_the_date() ), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), - get_the_author() - ); -} + // Set up and print post meta information. + printf( + ' ', + esc_url( get_permalink() ), + esc_attr( get_the_date( 'c' ) ), + esc_html( get_the_date() ), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), + get_the_author() + ); + } endif; /** @@ -130,9 +133,11 @@ endif; function twentyfourteen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { // Create an array of all the categories that are attached to posts - $all_the_cool_cats = get_categories( array( - 'hide_empty' => 1, - ) ); + $all_the_cool_cats = get_categories( + array( + 'hide_empty' => 1, + ) + ); // Count the number of categories that are attached to the posts $all_the_cool_cats = count( $all_the_cool_cats ); @@ -159,69 +164,71 @@ function twentyfourteen_category_transient_flusher() { delete_transient( 'twentyfourteen_category_count' ); } add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); -add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); +add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) : -/** - * Display an optional post thumbnail. - * - * Wraps the post thumbnail in an anchor element on index - * views, or a div element when on single views. - * - * @since Twenty Fourteen 1.0 - * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. - */ -function twentyfourteen_post_thumbnail() { - if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { - return; - } + /** + * Display an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index + * views, or a div element when on single views. + * + * @since Twenty Fourteen 1.0 + * @since Twenty Fourteen 1.4 Was made 'pluggable', or overridable. + */ + function twentyfourteen_post_thumbnail() { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { + return; + } - if ( is_singular() ) : - ?> + if ( is_singular() ) : + ?> -
- + -
+ ?> +
- + - %2$s', - esc_url( get_permalink( get_the_ID() ) ), + /** + * Replaces "[...]" (appended to automatically generated excerpts) with ... + * and a Continue reading link. + * + * @since Twenty Fourteen 1.3 + * + * @param string $more Default Read More excerpt link. + * @return string Filtered Read More excerpt link. + */ + function twentyfourteen_excerpt_more( $more ) { + $link = sprintf( + '%2$s', + esc_url( get_permalink( get_the_ID() ) ), /* translators: %s: Name of current post */ sprintf( __( 'Continue reading %s ', 'twentyfourteen' ), '' . get_the_title( get_the_ID() ) . '' ) ); - return ' … ' . $link; -} -add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); + return ' … ' . $link; + } + add_filter( 'excerpt_more', 'twentyfourteen_excerpt_more' ); endif; diff --git a/themes/twentyfourteen/inc/widgets.php b/themes/twentyfourteen/inc/widgets.php index 533f34a5..64118b5e 100644 --- a/themes/twentyfourteen/inc/widgets.php +++ b/themes/twentyfourteen/inc/widgets.php @@ -16,7 +16,6 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * The supported post formats. * - * @access private * @since Twenty Fourteen 1.0 * * @var array @@ -31,11 +30,13 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * @return Twenty_Fourteen_Ephemera_Widget */ public function __construct() { - parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( - 'classname' => 'widget_twentyfourteen_ephemera', - 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), - 'customize_selective_refresh' => true, - ) ); + parent::__construct( + 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array( + 'classname' => 'widget_twentyfourteen_ephemera', + 'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts.', 'twentyfourteen' ), + 'customize_selective_refresh' => true, + ) + ); if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); @@ -62,7 +63,6 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { /** * Output the HTML for this widget. * - * @access public * @since Twenty Fourteen 1.0 * * @param array $args An array of standard parameters for widgets in this theme. @@ -106,24 +106,26 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); - $ephemera = new WP_Query( array( - 'order' => 'DESC', - 'posts_per_page' => $number, - 'no_found_rows' => true, - 'post_status' => 'publish', - 'post__not_in' => get_option( 'sticky_posts' ), - 'tax_query' => array( - array( - 'taxonomy' => 'post_format', - 'terms' => array( "post-format-$format" ), - 'field' => 'slug', - 'operator' => 'IN', + $ephemera = new WP_Query( + array( + 'order' => 'DESC', + 'posts_per_page' => $number, + 'no_found_rows' => true, + 'post_status' => 'publish', + 'post__not_in' => get_option( 'sticky_posts' ), + 'tax_query' => array( + array( + 'taxonomy' => 'post_format', + 'terms' => array( "post-format-$format" ), + 'field' => 'slug', + 'operator' => 'IN', + ), ), - ), - ) ); + ) + ); if ( $ephemera->have_posts() ) : - $tmp_content_width = $GLOBALS['content_width']; + $tmp_content_width = $GLOBALS['content_width']; $GLOBALS['content_width'] = 306; echo $args['before_widget']; @@ -134,61 +136,65 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
    have_posts() ) : - $ephemera->the_post(); - $tmp_more = $GLOBALS['more']; - $GLOBALS['more'] = 0; + while ( $ephemera->have_posts() ) : + $ephemera->the_post(); + $tmp_more = $GLOBALS['more']; + $GLOBALS['more'] = 0; ?>
  1. > -
    - →', 'twentyfourteen' ) ); - else : - $images = array(); - - $galleries = get_post_galleries( get_the_ID(), false ); - if ( isset( $galleries[0]['ids'] ) ) - $images = explode( ',', $galleries[0]['ids'] ); - - if ( ! $images ) : - $images = get_posts( array( - 'fields' => 'ids', - 'numberposts' => -1, - 'order' => 'ASC', - 'orderby' => 'menu_order', +
    + →', 'twentyfourteen' ) ); + else : + $images = array(); + + $galleries = get_post_galleries( get_the_ID(), false ); + if ( isset( $galleries[0]['ids'] ) ) { + $images = explode( ',', $galleries[0]['ids'] ); + } + + if ( ! $images ) : + $images = get_posts( + array( + 'fields' => 'ids', + 'numberposts' => -1, + 'order' => 'ASC', + 'orderby' => 'menu_order', 'post_mime_type' => 'image', - 'post_parent' => get_the_ID(), - 'post_type' => 'attachment', - ) ); - endif; + 'post_parent' => get_the_ID(), + 'post_type' => 'attachment', + ) + ); + endif; - $total_images = count( $images ); + $total_images = count( $images ); - if ( has_post_thumbnail() ) : - $post_thumbnail = get_the_post_thumbnail(); + if ( has_post_thumbnail() ) : + $post_thumbnail = get_the_post_thumbnail(); elseif ( $total_images > 0 ) : $image = reset( $images ); $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' ); endif; - if ( ! empty ( $post_thumbnail ) ) : + if ( ! empty( $post_thumbnail ) ) : ?>

    - %2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyfourteen' ), - esc_url( get_permalink() ), - number_format_i18n( $total_images ) - ); - ?> + %2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyfourteen' ), + esc_url( get_permalink() ), + number_format_i18n( $total_images ) + ); + ?>

    →', 'twentyfourteen' ) ); @@ -198,20 +204,21 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
    ' ); +

    ', '

    ' ); - // Output the authors list. - twentyfourteen_list_authors(); + // Output the authors list. + twentyfourteen_list_authors(); - edit_post_link( __( 'Edit', 'twentyfourteen' ), '
    ', '
    ' ); - ?> + edit_post_link( __( 'Edit', 'twentyfourteen' ), '
    ', '
    ' ); + ?>
diff --git a/themes/twentyfourteen/page-templates/full-width.php b/themes/twentyfourteen/page-templates/full-width.php index 8830c870..ea5fa588 100644 --- a/themes/twentyfourteen/page-templates/full-width.php +++ b/themes/twentyfourteen/page-templates/full-width.php @@ -12,25 +12,26 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/page.php b/themes/twentyfourteen/page.php index 44724e94..bd033aeb 100644 --- a/themes/twentyfourteen/page.php +++ b/themes/twentyfourteen/page.php @@ -16,25 +16,26 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/readme.txt b/themes/twentyfourteen/readme.txt index bb027240..96b7a3a3 100644 --- a/themes/twentyfourteen/readme.txt +++ b/themes/twentyfourteen/readme.txt @@ -2,7 +2,7 @@ Contributors: the WordPress team Requires at least: WordPress 3.6 Tested up to: WordPress 5.0-trunk -Stable tag: 2.1 +Stable tag: 2.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready @@ -22,7 +22,7 @@ For more information about Twenty Fourteen please go to https://codex.wordpress. == Copyright == -Twenty Fourteen WordPress Theme, Copyright 2013-2017 WordPress.org & Automattic.com +Twenty Fourteen WordPress Theme, Copyright 2013-2018 WordPress.org & Automattic.com Twenty Fourteen is Distributed under the terms of the GNU GPL This program is free software: you can redistribute it and/or modify @@ -50,6 +50,11 @@ Source: http://www.genericons.com == Changelog == += 2.2 = +* Released: May 17, 2018 + +https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.2 + = 2.1 = * Released: November 14, 2017 diff --git a/themes/twentyfourteen/rtl.css b/themes/twentyfourteen/rtl.css index 5ff7312c..58d97579 100644 --- a/themes/twentyfourteen/rtl.css +++ b/themes/twentyfourteen/rtl.css @@ -288,6 +288,9 @@ td { margin-left: 10px; } +.comment-form #wp-comment-cookies-consent { + margin: 0 0 0 10px; +} /** * 7.0 Sidebars @@ -355,6 +358,14 @@ td { margin: -1px 0 0 18px; } +/** + * 8.0 Footer + * ----------------------------------------------------------------------------- + */ + +.site-info span[role=separator] { + padding: 0 0.5em; +} /** * 9.0 Featured Content @@ -855,4 +866,4 @@ td { margin-left: -18%; margin-right: auto; } -} \ No newline at end of file +} diff --git a/themes/twentyfourteen/search.php b/themes/twentyfourteen/search.php index d90d88a1..6945c40a 100644 --- a/themes/twentyfourteen/search.php +++ b/themes/twentyfourteen/search.php @@ -20,14 +20,15 @@ get_header(); ?>

diff --git a/themes/twentyfourteen/single.php b/themes/twentyfourteen/single.php index e089165e..1940c732 100644 --- a/themes/twentyfourteen/single.php +++ b/themes/twentyfourteen/single.php @@ -13,22 +13,23 @@ get_header(); ?>
diff --git a/themes/twentyfourteen/style.css b/themes/twentyfourteen/style.css index 32ed8373..46a86b4c 100644 --- a/themes/twentyfourteen/style.css +++ b/themes/twentyfourteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfourteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier. -Version: 2.1 +Version: 2.2 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready @@ -2186,6 +2186,13 @@ a.post-thumbnail:hover { margin-bottom: 0; } +.comment-form #wp-comment-cookies-consent { + margin: 0 10px 0 0; +} + +.comment-form .comment-form-cookies-consent label { + display: inline; +} /** * 7.0 Sidebars @@ -2916,6 +2923,13 @@ a.post-thumbnail:hover { color: #41a62a; } +.site-info span[role=separator] { + padding: 0 0.25em 0 0.5em; +} + +.site-info span[role=separator]::before { + content: '\002f'; +} /** * 9.0 Featured Content diff --git a/themes/twentyfourteen/tag.php b/themes/twentyfourteen/tag.php index 5930d2cf..663fe5e9 100644 --- a/themes/twentyfourteen/tag.php +++ b/themes/twentyfourteen/tag.php @@ -24,22 +24,23 @@ get_header(); ?> %s
', $term_description ); + if ( ! empty( $term_description ) ) : + printf( '
%s
', $term_description ); endif; ?>