Commit 7d0a21f3 authored by lucha's avatar lucha

[auto] theme: twentysixteen 1.8

parent 885c6a56
...@@ -32,7 +32,8 @@ get_header(); ?> ...@@ -32,7 +32,8 @@ get_header(); ?>
<?php <?php
// Start the Loop. // Start the Loop.
while ( have_posts() ) : the_post(); while ( have_posts() ) :
the_post();
/* /*
* Include the Post-Format-specific template for the content. * Include the Post-Format-specific template for the content.
...@@ -41,17 +42,19 @@ get_header(); ?> ...@@ -41,17 +42,19 @@ get_header(); ?>
*/ */
get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', get_post_format() );
// End the loop. // End the loop.
endwhile; endwhile;
// Previous/next page navigation. // Previous/next page navigation.
the_posts_pagination( array( the_posts_pagination(
'prev_text' => __( 'Previous page', 'twentysixteen' ), array(
'next_text' => __( 'Next page', 'twentysixteen' ), 'prev_text' => __( 'Previous page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>', 'next_text' => __( 'Next page', 'twentysixteen' ),
) ); 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
)
);
// If no content, include the "No posts found" template. // If no content, include the "No posts found" template.
else : else :
get_template_part( 'template-parts/content', 'none' ); get_template_part( 'template-parts/content', 'none' );
......
...@@ -26,23 +26,23 @@ if ( post_password_required() ) { ...@@ -26,23 +26,23 @@ if ( post_password_required() ) {
<h2 class="comments-title"> <h2 class="comments-title">
<?php <?php
$comments_number = get_comments_number(); $comments_number = get_comments_number();
if ( '1' === $comments_number ) { if ( '1' === $comments_number ) {
/* translators: %s: post title */ /* translators: %s: post title */
printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentysixteen' ), get_the_title() ); printf( _x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'twentysixteen' ), get_the_title() );
} else { } else {
printf( printf(
/* translators: 1: number of comments, 2: post title */ /* translators: 1: number of comments, 2: post title */
_nx( _nx(
'%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thought on &ldquo;%2$s&rdquo;',
'%1$s thoughts on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;',
$comments_number, $comments_number,
'comments title', 'comments title',
'twentysixteen' 'twentysixteen'
), ),
number_format_i18n( $comments_number ), number_format_i18n( $comments_number ),
get_the_title() get_the_title()
); );
} }
?> ?>
</h2> </h2>
...@@ -50,11 +50,13 @@ if ( post_password_required() ) { ...@@ -50,11 +50,13 @@ if ( post_password_required() ) {
<ol class="comment-list"> <ol class="comment-list">
<?php <?php
wp_list_comments( array( wp_list_comments(
'style' => 'ol', array(
'short_ping' => true, 'style' => 'ol',
'avatar_size' => 42, 'short_ping' => true,
) ); 'avatar_size' => 42,
)
);
?> ?>
</ol><!-- .comment-list --> </ol><!-- .comment-list -->
...@@ -64,16 +66,18 @@ if ( post_password_required() ) { ...@@ -64,16 +66,18 @@ if ( post_password_required() ) {
<?php <?php
// If comments are closed and there are comments, let's leave a little note, shall we? // If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?> ?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p> <p class="no-comments"><?php _e( 'Comments are closed.', 'twentysixteen' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php <?php
comment_form( array( comment_form(
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', array(
'title_reply_after' => '</h2>', 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
) ); 'title_reply_after' => '</h2>',
?> )
);
?>
</div><!-- .comments-area --> </div><!-- .comments-area -->
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
<?php if ( has_nav_menu( 'primary' ) ) : ?> <?php if ( has_nav_menu( 'primary' ) ) : ?>
<nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>"> <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>">
<?php <?php
wp_nav_menu( array( wp_nav_menu(
'theme_location' => 'primary', array(
'menu_class' => 'primary-menu', 'theme_location' => 'primary',
) ); 'menu_class' => 'primary-menu',
)
);
?> ?>
</nav><!-- .main-navigation --> </nav><!-- .main-navigation -->
<?php endif; ?> <?php endif; ?>
...@@ -27,13 +29,15 @@ ...@@ -27,13 +29,15 @@
<?php if ( has_nav_menu( 'social' ) ) : ?> <?php if ( has_nav_menu( 'social' ) ) : ?>
<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>"> <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>">
<?php <?php
wp_nav_menu( array( wp_nav_menu(
'theme_location' => 'social', array(
'menu_class' => 'social-links-menu', 'theme_location' => 'social',
'depth' => 1, 'menu_class' => 'social-links-menu',
'link_before' => '<span class="screen-reader-text">', 'depth' => 1,
'link_after' => '</span>', 'link_before' => '<span class="screen-reader-text">',
) ); 'link_after' => '</span>',
)
);
?> ?>
</nav><!-- .social-navigation --> </nav><!-- .social-navigation -->
<?php endif; ?> <?php endif; ?>
......
...@@ -33,173 +33,187 @@ if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) { ...@@ -33,173 +33,187 @@ if ( version_compare( $GLOBALS['wp_version'], '4.4-alpha', '<' ) ) {
} }
if ( ! function_exists( 'twentysixteen_setup' ) ) : if ( ! function_exists( 'twentysixteen_setup' ) ) :
/** /**
* Sets up theme defaults and registers support for various WordPress features. * Sets 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 for post thumbnails.
*
* Create your own twentysixteen_setup() function to override in a child theme.
*
* @since Twenty Sixteen 1.0
*/
function twentysixteen_setup() {
/*
* Make theme available for translation.
* Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen
* If you're building a theme based on Twenty Sixteen, use a find and replace
* to change 'twentysixteen' to the name of your theme in all the template files
*/
load_theme_textdomain( 'twentysixteen' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for custom logo.
* *
* @since Twenty Sixteen 1.2 * 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
add_theme_support( 'custom-logo', array( * as indicating support for post thumbnails.
'height' => 240,
'width' => 240,
'flex-height' => true,
) );
/*
* Enable support for Post Thumbnails on posts and pages.
* *
* @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails * Create your own twentysixteen_setup() function to override in a child theme.
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1200, 9999 );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'twentysixteen' ),
'social' => __( 'Social Links Menu', 'twentysixteen' ),
) );
/*
* 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',
) );
/*
* Enable support for Post Formats.
* *
* See: https://codex.wordpress.org/Post_Formats * @since Twenty Sixteen 1.0
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
'gallery',
'status',
'audio',
'chat',
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/ */
add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); function twentysixteen_setup() {
/*
// Load regular editor styles into the new block-based editor. * Make theme available for translation.
add_theme_support( 'editor-styles' ); * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen
* If you're building a theme based on Twenty Sixteen, use a find and replace
// Load default block styles. * to change 'twentysixteen' to the name of your theme in all the template files
add_theme_support( 'wp-block-styles' ); */
load_theme_textdomain( 'twentysixteen' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' ); // Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array( /*
array( * Let WordPress manage the document title.
'name' => __( 'Dark Gray', 'twentysixteen' ), * By adding theme support, we declare that this theme does not use a
'slug' => 'dark-gray', * hard-coded <title> tag in the document head, and expect WordPress to
'color' => '#1a1a1a', * provide it for us.
), */
array( add_theme_support( 'title-tag' );
'name' => __( 'Medium Gray', 'twentysixteen' ),
'slug' => 'medium-gray', /*
'color' => '#686868', * Enable support for custom logo.
), *
array( * @since Twenty Sixteen 1.2
'name' => __( 'Light Gray', 'twentysixteen' ), */
'slug' => 'light-gray', add_theme_support(
'color' => '#e5e5e5', 'custom-logo',
), array(
array( 'height' => 240,
'name' => __( 'White', 'twentysixteen' ), 'width' => 240,
'slug' => 'white', 'flex-height' => true,
'color' => '#fff', )
), );
array(
'name' => __( 'Blue Gray', 'twentysixteen' ), /*
'slug' => 'blue-gray', * Enable support for Post Thumbnails on posts and pages.
'color' => '#4d545c', *
), * @link https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
array( */
'name' => __( 'Bright Blue', 'twentysixteen' ), add_theme_support( 'post-thumbnails' );
'slug' => 'bright-blue', set_post_thumbnail_size( 1200, 9999 );
'color' => '#007acc',
), // This theme uses wp_nav_menu() in two locations.
array( register_nav_menus(
'name' => __( 'Light Blue', 'twentysixteen' ), array(
'slug' => 'light-blue', 'primary' => __( 'Primary Menu', 'twentysixteen' ),
'color' => '#9adffd', 'social' => __( 'Social Links Menu', 'twentysixteen' ),
), )
array( );
'name' => __( 'Dark Brown', 'twentysixteen' ),
'slug' => 'dark-brown', /*
'color' => '#402b30', * Switch default core markup for search form, comment form, and comments
), * to output valid HTML5.
array( */
'name' => __( 'Medium Brown', 'twentysixteen' ), add_theme_support(
'slug' => 'medium-brown', 'html5',
'color' => '#774e24', array(
), 'search-form',
array( 'comment-form',
'name' => __( 'Dark Red', 'twentysixteen' ), 'comment-list',
'slug' => 'dark-red', 'gallery',
'color' => '#640c1f', 'caption',
), )
array( );
'name' => __( 'Bright Red', 'twentysixteen' ),
'slug' => 'bright-red', /*
'color' => '#ff675f', * Enable support for Post Formats.
), *
array( * See: https://codex.wordpress.org/Post_Formats
'name' => __( 'Yellow', 'twentysixteen' ), */
'slug' => 'yellow', add_theme_support(
'color' => '#ffef8e', 'post-formats',
), array(
) ); 'aside',
'image',
// Indicate widget sidebars can use selective refresh in the Customizer. 'video',
add_theme_support( 'customize-selective-refresh-widgets' ); 'quote',
} 'link',
'gallery',
'status',
'audio',
'chat',
)
);
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) );
// Load regular editor styles into the new block-based editor.
add_theme_support( 'editor-styles' );
// Load default block styles.
add_theme_support( 'wp-block-styles' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support(
'editor-color-palette',
array(
array(
'name' => __( 'Dark Gray', 'twentysixteen' ),
'slug' => 'dark-gray',
'color' => '#1a1a1a',
),
array(
'name' => __( 'Medium Gray', 'twentysixteen' ),
'slug' => 'medium-gray',
'color' => '#686868',
),
array(
'name' => __( 'Light Gray', 'twentysixteen' ),
'slug' => 'light-gray',
'color' => '#e5e5e5',
),
array(
'name' => __( 'White', 'twentysixteen' ),
'slug' => 'white',
'color' => '#fff',
),
array(
'name' => __( 'Blue Gray', 'twentysixteen' ),
'slug' => 'blue-gray',
'color' => '#4d545c',
),
array(
'name' => __( 'Bright Blue', 'twentysixteen' ),
'slug' => 'bright-blue',
'color' => '#007acc',
),
array(
'name' => __( 'Light Blue', 'twentysixteen' ),
'slug' => 'light-blue',
'color' => '#9adffd',
),
array(
'name' => __( 'Dark Brown', 'twentysixteen' ),
'slug' => 'dark-brown',
'color' => '#402b30',
),
array(
'name' => __( 'Medium Brown', 'twentysixteen' ),
'slug' => 'medium-brown',
'color' => '#774e24',
),
array(
'name' => __( 'Dark Red', 'twentysixteen' ),
'slug' => 'dark-red',
'color' => '#640c1f',
),
array(
'name' => __( 'Bright Red', 'twentysixteen' ),
'slug' => 'bright-red',
'color' => '#ff675f',
),
array(
'name' => __( 'Yellow', 'twentysixteen' ),
'slug' => 'yellow',
'color' => '#ffef8e',
),
)
);
// Indicate widget sidebars can use selective refresh in the Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // twentysixteen_setup endif; // twentysixteen_setup
add_action( 'after_setup_theme', 'twentysixteen_setup' ); add_action( 'after_setup_theme', 'twentysixteen_setup' );
...@@ -225,77 +239,86 @@ add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); ...@@ -225,77 +239,86 @@ add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 );
* @since Twenty Sixteen 1.0 * @since Twenty Sixteen 1.0
*/ */
function twentysixteen_widgets_init() { function twentysixteen_widgets_init() {
register_sidebar( array( register_sidebar(
'name' => __( 'Sidebar', 'twentysixteen' ), array(
'id' => 'sidebar-1', 'name' => __( 'Sidebar', 'twentysixteen' ),
'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), 'id' => 'sidebar-1',
'before_widget' => '<section id="%1$s" class="widget %2$s">', 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ),
'after_widget' => '</section>', 'before_widget' => '<section id="%1$s" class="widget %2$s">',
'before_title' => '<h2 class="widget-title">', 'after_widget' => '</section>',
'after_title' => '</h2>', 'before_title' => '<h2 class="widget-title">',
) ); 'after_title' => '</h2>',
)
register_sidebar( array( );
'name' => __( 'Content Bottom 1', 'twentysixteen' ),
'id' => 'sidebar-2', register_sidebar(
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), array(
'before_widget' => '<section id="%1$s" class="widget %2$s">', 'name' => __( 'Content Bottom 1', 'twentysixteen' ),
'after_widget' => '</section>', 'id' => 'sidebar-2',
'before_title' => '<h2 class="widget-title">', 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ),
'after_title' => '</h2>', 'before_widget' => '<section id="%1$s" class="widget %2$s">',
) ); 'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
register_sidebar( array( 'after_title' => '</h2>',
'name' => __( 'Content Bottom 2', 'twentysixteen' ), )
'id' => 'sidebar-3', );
'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">', register_sidebar(
'after_widget' => '</section>', array(
'before_title' => '<h2 class="widget-title">', 'name' => __( 'Content Bottom 2', 'twentysixteen' ),
'after_title' => '</h2>', 'id' => 'sidebar-3',
) ); 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
} }
add_action( 'widgets_init', 'twentysixteen_widgets_init' ); add_action( 'widgets_init', 'twentysixteen_widgets_init' );
if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : if ( ! function_exists( 'twentysixteen_fonts_url' ) ) :
/** /**
* Register Google fonts for Twenty Sixteen. * Register Google fonts for Twenty Sixteen.
* *
* Create your own twentysixteen_fonts_url() function to override in a child theme. * Create your own twentysixteen_fonts_url() function to override in a child theme.