Add medium crop image size to ensure gallery images are square

This commit is contained in:
Brian Miyaji
2016-01-08 19:15:26 +11:00
parent 13f78b9815
commit 571ea53ea3
5 changed files with 5 additions and 4 deletions

View File

@@ -316,6 +316,7 @@ final class SportsPress {
} }
// Add image sizes // Add image sizes
add_image_size( 'sportspress-crop-medium', 300, 300, true );
add_image_size( 'sportspress-fit-medium', 300, 300, false ); add_image_size( 'sportspress-fit-medium', 300, 300, false );
add_image_size( 'sportspress-fit-icon', 128, 128, false ); add_image_size( 'sportspress-fit-icon', 128, 128, false );
add_image_size( 'sportspress-fit-mini', 32, 32, false ); add_image_size( 'sportspress-fit-mini', 32, 32, false );

View File

@@ -14,7 +14,7 @@ $defaults = array(
'icontag' => 'dt', 'icontag' => 'dt',
'captiontag' => 'dd', 'captiontag' => 'dd',
'caption' => null, 'caption' => null,
'size' => 'medium', 'size' => 'sportspress-crop-medium',
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
); );

View File

@@ -22,7 +22,7 @@ $defaults = array(
'captiontag' => 'dd', 'captiontag' => 'dd',
'grouptag' => 'h4', 'grouptag' => 'h4',
'columns' => 3, 'columns' => 3,
'size' => 'medium', 'size' => 'sportspress-crop-medium',
'show_all_players_link' => false, 'show_all_players_link' => false,
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
); );

View File

@@ -16,7 +16,7 @@ if ( ! isset( $id ) )
if ( has_post_thumbnail( $id ) ): if ( has_post_thumbnail( $id ) ):
?> ?>
<div class="sp-template sp-template-player-photo sp-template-photo sp-player-photo"> <div class="sp-template sp-template-player-photo sp-template-photo sp-player-photo">
<?php echo get_the_post_thumbnail( $id, 'medium' ); ?> <?php echo get_the_post_thumbnail( $id, 'sportspress-fit-medium' ); ?>
</div> </div>
<?php <?php
endif; endif;

View File

@@ -16,7 +16,7 @@ if ( ! isset( $id ) )
if ( has_post_thumbnail( $id ) ): if ( has_post_thumbnail( $id ) ):
?> ?>
<div class="sp-template sp-template-staff-photo sp-template-photo sp-staff-photo"> <div class="sp-template sp-template-staff-photo sp-template-photo sp-staff-photo">
<?php echo get_the_post_thumbnail( $id, 'medium' ); ?> <?php echo get_the_post_thumbnail( $id, 'sportspress-fit-medium' ); ?>
</div> </div>
<?php <?php
endif; endif;