Commit ee8e325a authored by lucha's avatar lucha

[auto] theme: twentytwelve 2.8

parent 753d7b54
......@@ -26,4 +26,4 @@ get_header(); ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
\ No newline at end of file
<?php get_footer(); ?>
......@@ -24,9 +24,10 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php
if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
<h1 class="archive-title">
<?php
if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( is_year() ) :
......@@ -34,12 +35,14 @@ get_header(); ?>
else :
_e( 'Archives', 'twentytwelve' );
endif;
?></h1>
?>
</h1>
</header><!-- .archive-header -->
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
while ( have_posts() ) :
the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called content-___.php
......
......@@ -44,7 +44,8 @@ get_header(); ?>
<?php
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta( 'description' ) ) : ?>
if ( get_the_author_meta( 'description' ) ) :
?>
<div class="author-info">
<div class="author-avatar">
<?php
......@@ -67,7 +68,10 @@ get_header(); ?>
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
while ( have_posts() ) :
the_post();
?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
......
......@@ -27,7 +27,8 @@ get_header(); ?>
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
while ( have_posts() ) :
the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called content-___.php
......
......@@ -17,8 +17,9 @@
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() )
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="comments-area">
......@@ -28,13 +29,23 @@ if ( post_password_required() )
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
printf(
_n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ),
number_format_i18n( get_comments_number() ),
'<span>' . get_the_title() . '</span>'
);
?>
</h2>
<ol class="commentlist">
<?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
<?php
wp_list_comments(
array(
'callback' => 'twentytwelve_comment',
'style' => 'ol',
)
);
?>
</ol><!-- .commentlist -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
......@@ -49,12 +60,13 @@ if ( post_password_required() )
/* If there are no comments and comments are closed, let's leave a note.
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
if ( ! comments_open() && get_comments_number() ) :
?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments .comments-area -->
\ No newline at end of file
</div><!-- #comments .comments-area -->
......@@ -11,14 +11,21 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
<?php the_post_thumbnail(); ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
......
......@@ -17,9 +17,11 @@
</div>
<?php endif; ?>
<header class="entry-header">
<?php if ( ! post_password_required() && ! is_attachment() ) :
<?php
if ( ! post_password_required() && ! is_attachment() ) :
the_post_thumbnail();
endif; ?>
endif;
?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
......@@ -42,7 +44,14 @@
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
<?php endif; ?>
......
......@@ -99,13 +99,13 @@ p.has-drop-cap:not(:focus)::first-letter {
.wp-block-quote:not(.is-large):not(.is-style-large) {
border: 0;
padding: 1.714285714rem;
padding: 24px;
padding: 1.714285714rem;
}
.wp-block-quote {
padding: 1.714285714rem;
padding: 24px;
padding: 1.714285714rem;
}
.wp-block-quote cite {
......@@ -246,7 +246,6 @@ pre.wp-block-code {
.wp-block-button .wp-block-button__link {
border: 1px solid #d2d2d2;
border-radius: 3px;
font-family: inherit;
font-size: 11px;
font-size: 0.785714286rem;
......@@ -262,6 +261,12 @@ pre.wp-block-code {
color: #7c7c7c;
}
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link:visited {
background-color: inherit;
border-color: inherit;
}
.entry-content .wp-block-button__link:hover,
.entry-content .wp-block-button__link:visited:hover,
.entry-content .wp-block-button__link:focus {
......@@ -274,7 +279,7 @@ pre.wp-block-code {
color: #757575;
}
.wp-block-button__link:not(.has-background) {
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
......
......@@ -234,8 +234,7 @@ p.has-drop-cap:not(:focus)::first-letter {
text-decoration: underline;
}
.wp-block-file .wp-block-file__button,
.wp-block-button .wp-block-file__button:hover {
.wp-block-file .wp-block-file__button {
background-color: #e6e6e6;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
......@@ -342,7 +341,6 @@ p.has-drop-cap:not(:focus)::first-letter {
.wp-block-button .wp-block-button__link {
border: 1px solid #d2d2d2;
border-radius: 3px;
font-family: inherit;
font-size: 11px;
font-weight: normal;
......@@ -358,7 +356,12 @@ p.has-drop-cap:not(:focus)::first-letter {
box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
}
.wp-block-button .wp-block-button__link:not(.has-background) {
.wp-block-button.is-style-outline .wp-block-button__link {
background-color: inherit;
border-color: inherit;
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);
......
......@@ -27,4 +27,4 @@
<?php wp_footer(); ?>
</body>
</html>
\ No newline at end of file
</html>
......@@ -23,8 +23,9 @@
*/
// Set up the content width value based on the theme's design and stylesheet.
if ( ! isset( $content_width ) )
if ( ! isset( $content_width ) ) {
$content_width = 625;
}
/**
* Twenty Twelve setup.
......@@ -35,7 +36,7 @@ if ( ! isset( $content_width ) )
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_editor_style() To add a Visual Editor stylesheet.
* @uses add_theme_support() To add support for post thumbnails, automatic feed links,
* custom background, and post formats.
* custom background, and post formats.
* @uses register_nav_menu() To add support for navigation menus.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
......@@ -64,33 +65,36 @@ function twentytwelve_setup() {
add_theme_support( 'responsive-embeds' );
// Add support for custom color scheme.
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Blue', 'twentytwelve' ),
'slug' => 'blue',
'color' => '#21759b',
),
array(
'name' => __( 'Dark Gray', 'twentytwelve' ),
'slug' => 'dark-gray',
'color' => '#444',
),
add_theme_support(
'editor-color-palette',
array(
'name' => __( 'Medium Gray', 'twentytwelve' ),
'slug' => 'medium-gray',
'color' => '#9f9f9f',
),
array(
'name' => __( 'Light Gray', 'twentytwelve' ),
'slug' => 'light-gray',
'color' => '#e6e6e6',
),
array(
'name' => __( 'White', 'twentytwelve' ),
'slug' => 'white',
'color' => '#fff',
),
) );
array(
'name' => __( 'Blue', 'twentytwelve' ),
'slug' => 'blue',
'color' => '#21759b',
),
array(
'name' => __( 'Dark Gray', 'twentytwelve' ),
'slug' => 'dark-gray',
'color' => '#444',
),
array(
'name' => __( 'Medium Gray', 'twentytwelve' ),
'slug' => 'medium-gray',
'color' => '#9f9f9f',
),
array(
'name' => __( 'Light Gray', 'twentytwelve' ),
'slug' => 'light-gray',
'color' => '#e6e6e6',
),
array(
'name' => __( 'White', 'twentytwelve' ),
'slug' => 'white',
'color' => '#fff',
),
)
);
// Adds RSS feed links to <head> for posts and comments.
add_theme_support( 'automatic-feed-links' );
......@@ -105,9 +109,12 @@ function twentytwelve_setup() {
* This theme supports custom background color and image,
* and here we also set up the default background color.
*/
add_theme_support( 'custom-background', array(
'default-color' => 'e6e6e6',
) );
add_theme_support(
'custom-background',
array(
'default-color' => 'e6e6e6',
)
);
// This theme uses a custom image size for featured images, displayed on "standard" posts.
add_theme_support( 'post-thumbnails' );
......@@ -147,18 +154,19 @@ function twentytwelve_get_font_url() {
*/
$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
if ( 'cyrillic' == $subset )
if ( 'cyrillic' == $subset ) {
$subsets .= ',cyrillic,cyrillic-ext';
elseif ( 'greek' == $subset )
} elseif ( 'greek' == $subset ) {
$subsets .= ',greek,greek-ext';
elseif ( 'vietnamese' == $subset )
} elseif ( 'vietnamese' == $subset ) {
$subsets .= ',vietnamese';
}
$query_args = array(
'family' => 'Open+Sans:400italic,700italic,400,700',
'subset' => $subsets,
);
$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;
......@@ -176,21 +184,23 @@ function twentytwelve_scripts_styles() {
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
// Adds JavaScript for handling the navigation menu hide-and-show behavior.
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
$font_url = twentytwelve_get_font_url();
if ( ! empty( $font_url ) )
if ( ! empty( $font_url ) ) {
wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
}
// Loads our main stylesheet.
wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
// Theme block stylesheet.
wp_enqueue_style( 'twentytwelve-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentytwelve-style' ), '20181018' );
wp_enqueue_style( 'twentytwelve-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentytwelve-style' ), '20181230' );
// Loads the Internet Explorer specific stylesheet.
wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
......@@ -205,7 +215,7 @@ add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
*/
function twentytwelve_block_editor_styles() {
// Block styles.
wp_enqueue_style( 'twentytwelve-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css' );
wp_enqueue_style( 'twentytwelve-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' );
// Add custom fonts.
wp_enqueue_style( 'twentytwelve-fonts', twentytwelve_get_font_url(), array(), null );
}
......@@ -251,11 +261,13 @@ add_filter( 'wp_resource_hints', 'twentytwelve_resource_hints', 10, 2 );
function twentytwelve_mce_css( $mce_css ) {
$font_url = twentytwelve_get_font_url();
if ( empty( $font_url ) )
if ( empty( $font_url ) ) {
return $mce_css;
}
if ( ! empty( $mce_css ) )
if ( ! empty( $mce_css ) ) {
$mce_css .= ',';
}
$mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) );
......@@ -278,20 +290,23 @@ add_filter( 'mce_css', 'twentytwelve_mce_css' );
function twentytwelve_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
if ( is_feed() ) {
return $title;
}
// Add the site name.
$title .= get_bloginfo( 'name', 'display' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}
// Add a page number if necessary.
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
}
return $title;
}
......@@ -305,8 +320,9 @@ add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
* @since Twenty Twelve 1.0
*/
function twentytwelve_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
if ( ! isset( $args['show_home'] ) ) {
$args['show_home'] = true;
}
return $args;
}
add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
......@@ -319,168 +335,191 @@ add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
* @since Twenty Twelve 1.0
*/
function twentytwelve_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentytwelve' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-2',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-3',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(
array(
'name' => __( 'Main Sidebar', 'twentytwelve' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-2',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-3',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
)
);
}
add_action( 'widgets_init', 'twentytwelve_widgets_init' );
if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_nav( $html_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
</nav><!-- .navigation -->
<?php endif;
}
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_nav( $html_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo esc_attr( $html_id ); ?>" class="navigation" role="navigation">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
</nav><!-- .navigation -->
<?php
endif;
}
endif;
if ( ! function_exists( 'twentytwelve_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own twentytwelve_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own twentytwelve_comment(), and that function will be used instead.