Commit ee8e325a authored by lucha's avatar lucha

[auto] theme: twentytwelve 2.8

parent 753d7b54
...@@ -26,4 +26,4 @@ get_header(); ?> ...@@ -26,4 +26,4 @@ get_header(); ?>
</div><!-- #content --> </div><!-- #content -->
</div><!-- #primary --> </div><!-- #primary -->
<?php get_footer(); ?> <?php get_footer(); ?>
\ No newline at end of file
...@@ -24,9 +24,10 @@ get_header(); ?> ...@@ -24,9 +24,10 @@ get_header(); ?>
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="archive-header"> <header class="archive-header">
<h1 class="archive-title"><?php <h1 class="archive-title">
if ( is_day() ) : <?php
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' ); if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) : elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' ); printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( is_year() ) : elseif ( is_year() ) :
...@@ -34,12 +35,14 @@ get_header(); ?> ...@@ -34,12 +35,14 @@ get_header(); ?>
else : else :
_e( 'Archives', 'twentytwelve' ); _e( 'Archives', 'twentytwelve' );
endif; endif;
?></h1> ?>
</h1>
</header><!-- .archive-header --> </header><!-- .archive-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. If you want to /* 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 * this in a child theme then include a file called content-___.php
......
...@@ -44,7 +44,8 @@ get_header(); ?> ...@@ -44,7 +44,8 @@ get_header(); ?>
<?php <?php
// If a user has filled out their description, show a bio on their entries. // 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-info">
<div class="author-avatar"> <div class="author-avatar">
<?php <?php
...@@ -67,7 +68,10 @@ get_header(); ?> ...@@ -67,7 +68,10 @@ get_header(); ?>
<?php endif; ?> <?php endif; ?>
<?php /* Start the Loop */ ?> <?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 get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?> <?php endwhile; ?>
......
...@@ -27,7 +27,8 @@ get_header(); ?> ...@@ -27,7 +27,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. If you want to /* 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 * this in a child theme then include a file called content-___.php
......
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
* the visitor has not yet entered the password we will * the visitor has not yet entered the password we will
* return early without loading the comments. * return early without loading the comments.
*/ */
if ( post_password_required() ) if ( post_password_required() ) {
return; return;
}
?> ?>
<div id="comments" class="comments-area"> <div id="comments" class="comments-area">
...@@ -28,13 +29,23 @@ if ( post_password_required() ) ...@@ -28,13 +29,23 @@ if ( post_password_required() )
<?php if ( have_comments() ) : ?> <?php if ( have_comments() ) : ?>
<h2 class="comments-title"> <h2 class="comments-title">
<?php <?php
printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ), printf(
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); _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> </h2>
<ol class="commentlist"> <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 --> </ol><!-- .commentlist -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <?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() ) ...@@ -49,12 +60,13 @@ if ( post_password_required() )
/* If there are no comments and comments are closed, let's leave a note. /* 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. * But we only want the note on posts and pages that had comments in the first place.
*/ */
if ( ! comments_open() && get_comments_number() ) : ?> if ( ! comments_open() && get_comments_number() ) :
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p> ?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php endif; // have_comments() ?> <?php endif; // have_comments() ?>
<?php comment_form(); ?> <?php comment_form(); ?>
</div><!-- #comments .comments-area --> </div><!-- #comments .comments-area -->
\ No newline at end of file
...@@ -11,14 +11,21 @@ ...@@ -11,14 +11,21 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header"> <header class="entry-header">
<?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?> <?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
<?php the_post_thumbnail(); ?> <?php the_post_thumbnail(); ?>
<?php endif; ?> <?php endif; ?>
<h1 class="entry-title"><?php the_title(); ?></h1> <h1 class="entry-title"><?php the_title(); ?></h1>
</header> </header>
<div class="entry-content"> <div class="entry-content">
<?php the_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 --> </div><!-- .entry-content -->
<footer class="entry-meta"> <footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?> <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
......
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
<header class="entry-header"> <header class="entry-header">
<?php if ( ! post_password_required() && ! is_attachment() ) : <?php
if ( ! post_password_required() && ! is_attachment() ) :
the_post_thumbnail(); the_post_thumbnail();
endif; ?> endif;
?>
<?php if ( is_single() ) : ?> <?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1> <h1 class="entry-title"><?php the_title(); ?></h1>
...@@ -42,7 +44,14 @@ ...@@ -42,7 +44,14 @@
<?php else : ?> <?php else : ?>
<div class="entry-content"> <div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?> <?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 --> </div><!-- .entry-content -->
<?php endif; ?> <?php endif; ?>
......
...@@ -99,13 +99,13 @@ p.has-drop-cap:not(:focus)::first-letter { ...@@ -99,13 +99,13 @@ p.has-drop-cap:not(:focus)::first-letter {
.wp-block-quote:not(.is-large):not(.is-style-large) { .wp-block-quote:not(.is-large):not(.is-style-large) {
border: 0; border: 0;
padding: 1.714285714rem;
padding: 24px; padding: 24px;
padding: 1.714285714rem;
} }
.wp-block-quote { .wp-block-quote {
padding: 1.714285714rem;
padding: 24px; padding: 24px;
padding: 1.714285714rem;
} }
.wp-block-quote cite { .wp-block-quote cite {
...@@ -246,7 +246,6 @@ pre.wp-block-code { ...@@ -246,7 +246,6 @@ pre.wp-block-code {
.wp-block-button .wp-block-button__link { .wp-block-button .wp-block-button__link {
border: 1px solid #d2d2d2; border: 1px solid #d2d2d2;
border-radius: 3px;
font-family: inherit; font-family: inherit;
font-size: 11px; font-size: 11px;
font-size: 0.785714286rem; font-size: 0.785714286rem;
...@@ -262,6 +261,12 @@ pre.wp-block-code { ...@@ -262,6 +261,12 @@ pre.wp-block-code {
color: #7c7c7c; 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:hover,
.entry-content .wp-block-button__link:visited:hover, .entry-content .wp-block-button__link:visited:hover,
.entry-content .wp-block-button__link:focus { .entry-content .wp-block-button__link:focus {
...@@ -274,7 +279,7 @@ pre.wp-block-code { ...@@ -274,7 +279,7 @@ pre.wp-block-code {
color: #757575; 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-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6); background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -ms-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 { ...@@ -234,8 +234,7 @@ p.has-drop-cap:not(:focus)::first-letter {
text-decoration: underline; text-decoration: underline;
} }
.wp-block-file .wp-block-file__button, .wp-block-file .wp-block-file__button {
.wp-block-button .wp-block-file__button:hover {
background-color: #e6e6e6; background-color: #e6e6e6;
background-repeat: repeat-x; background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6); background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
...@@ -342,7 +341,6 @@ p.has-drop-cap:not(:focus)::first-letter { ...@@ -342,7 +341,6 @@ p.has-drop-cap:not(:focus)::first-letter {
.wp-block-button .wp-block-button__link { .wp-block-button .wp-block-button__link {
border: 1px solid #d2d2d2; border: 1px solid #d2d2d2;
border-radius: 3px;
font-family: inherit; font-family: inherit;
font-size: 11px; font-size: 11px;
font-weight: normal; font-weight: normal;
...@@ -358,7 +356,12 @@ p.has-drop-cap:not(:focus)::first-letter { ...@@ -358,7 +356,12 @@ p.has-drop-cap:not(:focus)::first-letter {
box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1); 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: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6); background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6); background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);
......
...@@ -27,4 +27,4 @@ ...@@ -27,4 +27,4 @@
<?php wp_footer(); ?> <?php wp_footer(); ?>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -42,7 +42,14 @@ ...@@ -42,7 +42,14 @@
<nav id="site-navigation" class="main-navigation" role="navigation"> <nav id="site-navigation" class="main-navigation" role="navigation">
<button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button> <button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a> <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> <?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'nav-menu',
)
);
?>
</nav><!-- #site-navigation --> </nav><!-- #site-navigation -->
<?php if ( get_header_image() ) : ?> <?php if ( get_header_image() ) : ?>
...@@ -50,4 +57,4 @@ ...@@ -50,4 +57,4 @@
<?php endif; ?> <?php endif; ?>
</header><!-- #masthead --> </header><!-- #masthead -->
<div id="main" class="wrapper"> <div id="main" class="wrapper">
\ No newline at end of file
...@@ -14,7 +14,10 @@ get_header(); ?> ...@@ -14,7 +14,10 @@ get_header(); ?>
<div id="primary" class="site-content"> <div id="primary" class="site-content">
<div id="content" role="main"> <div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?> <?php
while ( have_posts() ) :
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
<header class="entry-header"> <header class="entry-header">
...@@ -23,7 +26,8 @@ get_header(); ?> ...@@ -23,7 +26,8 @@ get_header(); ?>
<footer class="entry-meta"> <footer class="entry-meta">
<?php <?php
$metadata = wp_get_attachment_metadata(); $metadata = wp_get_attachment_metadata();
printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ), printf(
__( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
esc_attr( get_the_date( 'c' ) ), esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ), esc_html( get_the_date() ),
esc_url( wp_get_attachment_url() ), esc_url( wp_get_attachment_url() ),
...@@ -47,46 +51,60 @@ get_header(); ?> ...@@ -47,46 +51,60 @@ get_header(); ?>
<div class="entry-attachment"> <div class="entry-attachment">
<div class="attachment"> <div class="attachment">
<?php <?php
/* /*
* 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, * 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 * 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
*/ */
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); $attachments = array_values(
foreach ( $attachments as $k => $attachment ) : get_children(
if ( $attachment->ID == $post->ID ) array(
break; 'post_parent' => $post->post_parent,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID',
)
)
);
foreach ( $attachments as $k => $attachment ) :
if ( $attachment->ID == $post->ID ) {
break;
}
endforeach; endforeach;
// If there is more than 1 attachment in a gallery // If there is more than 1 attachment in a gallery
if ( count( $attachments ) > 1 ) : if ( count( $attachments ) > 1 ) :
$k++; $k++;
if ( isset( $attachments[ $k ] ) ) : if ( isset( $attachments[ $k ] ) ) :
// get the URL of the next image attachment // get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
else : else :
// or get the URL of the first image attachment // or get the URL of the first image attachment
$next_attachment_url = get_attachment_link( $attachments[0]->ID ); $next_attachment_url = get_attachment_link( $attachments[0]->ID );
endif; endif;
else : else :
// or, if there's only 1 image, get the URL of the image // or, if there's only 1 image, get the URL of the image
$next_attachment_url = wp_get_attachment_url(); $next_attachment_url = wp_get_attachment_url();
endif; endif;
?> ?>
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
/** <?php
* Filter the image attachment size to use. /**
* * Filter the image attachment size to use.
* @since Twenty Twelve 1.0 *
* * @since Twenty Twelve 1.0
* @param array $size { *
* @type int The attachment height in pixels. * @param array $size {
* @type int The attachment width in pixels. * @type int The attachment height in pixels.
* } * @type int The attachment width in pixels.
*/ * }
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) ); */
echo wp_get_attachment_image( $post->ID, $attachment_size ); $attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
?></a> echo wp_get_attachment_image( $post->ID, $attachment_size );
?>
</a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?> <?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption"> <div class="entry-caption">
...@@ -99,7 +117,14 @@ endif; ...@@ -99,7 +117,14 @@ endif;
<div class="entry-description"> <div class="entry-description">
<?php the_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-description --> </div><!-- .entry-description -->
</div><!-- .entry-content --> </div><!-- .entry-content -->
......
...@@ -54,8 +54,9 @@ add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' ); ...@@ -54,8 +54,9 @@ add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' );
*/ */
function twentytwelve_custom_header_fonts() { function twentytwelve_custom_header_fonts() {
$font_url = twentytwelve_get_font_url(); $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 ); wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
}
} }
add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' ); add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' );
...@@ -70,26 +71,27 @@ function twentytwelve_header_style() { ...@@ -70,26 +71,27 @@ function twentytwelve_header_style() {
$text_color = get_header_textcolor(); $text_color = get_header_textcolor();
// If no custom options for text are set, let's bail // If no custom options for text are set, let's bail
if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
return; return;
}
// If we get this far, we have custom styles. // If we get this far, we have custom styles.
?> ?>
<style type="text/css" id="twentytwelve-header-css"> <style type="text/css" id="twentytwelve-header-css">
<?php <?php
// Has the text been hidden? // Has the text been hidden?
if ( ! display_header_text() ) : if ( ! display_header_text() ) :
?> ?>
.site-title, .site-title,
.site-description { .site-description {
position: absolute; position: absolute;