Twenty Thirteen: Use the_post_format_gallery(). props obenland, fixes #24126.
git-svn-id: http://core.svn.wordpress.org/trunk@24029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ef3d64ccd9
commit
68d29b46c5
|
@ -24,7 +24,7 @@
|
|||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?>
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
|
||||
<?php else : ?>
|
||||
<?php twentythirteen_featured_gallery(); ?>
|
||||
<?php the_post_format_gallery(); ?>
|
||||
<?php endif; // is_single() ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
|
|
|
@ -445,39 +445,21 @@ function twentythirteen_get_link_url() {
|
|||
return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'twentythirteen_featured_gallery' ) ) :
|
||||
/**
|
||||
* Displays first gallery from post content. Changes image size from thumbnail
|
||||
* to large, to display a larger first image.
|
||||
*
|
||||
* @since Twenty Thirteen 1.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function twentythirteen_featured_gallery() {
|
||||
$pattern = get_shortcode_regex();
|
||||
|
||||
if ( preg_match( "/$pattern/s", get_the_content(), $match ) && 'gallery' == $match[2] ) {
|
||||
add_filter( 'shortcode_atts_gallery', 'twentythirteen_gallery_atts' );
|
||||
echo do_shortcode_tag( $match );
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Sets the image size in featured galleries to large.
|
||||
*
|
||||
* @see twentythirteen_featured_gallery()
|
||||
*
|
||||
* @since Twenty Thirteen 1.0
|
||||
*
|
||||
* @param array $atts Combined and filtered attribute list.
|
||||
* @return array
|
||||
*/
|
||||
function twentythirteen_gallery_atts( $atts ) {
|
||||
$atts['size'] = 'large';
|
||||
if ( has_post_format( 'gallery' ) && ! is_single() )
|
||||
$atts['size'] = 'large';
|
||||
|
||||
return $atts;
|
||||
}
|
||||
add_filter( 'shortcode_atts_gallery', 'twentythirteen_gallery_atts' );
|
||||
|
||||
/**
|
||||
* Extends the default WordPress body class to denote:
|
||||
|
|
Loading…
Reference in New Issue