Tweak countdown image feature

This commit is contained in:
Brian Miyaji
2018-05-03 15:45:25 +10:00
parent 6c4b1e981d
commit 8ab0f20f17
3 changed files with 14 additions and 9 deletions

View File

@@ -493,6 +493,10 @@
} }
/* Countdowns */ /* Countdowns */
.sp-template-countdown .event-image img {
display: block;
margin: 0 auto;
}
.sp-template-countdown .event-name { .sp-template-countdown .event-name {
clear: both; clear: both;
overflow: hidden; overflow: hidden;

View File

@@ -82,18 +82,19 @@ class SportsPress_Countdowns {
apply_filters( 'sportspress_countdown_options', array( apply_filters( 'sportspress_countdown_options', array(
array( array(
'title' => __( 'Teams', 'sportspress' ), 'title' => __( 'Display', 'sportspress' ),
'desc' => __( 'Display logos', 'sportspress' ), 'desc' => __( 'Logos', 'sportspress' ),
'id' => 'sportspress_countdown_show_logos', 'id' => 'sportspress_countdown_show_logos',
'default' => 'no', 'default' => 'no',
'type' => 'checkbox', 'type' => 'checkbox',
'checkboxgroup' => 'start',
), ),
array( array(
'title' => __( 'Featured Image', 'sportspress' ), 'desc' => __( 'Featured Image', 'sportspress' ),
'desc' => __( 'Display featured image of event', 'sportspress' ), 'id' => 'sportspress_countdown_show_thumbnail',
'id' => 'sportspress_countdown_show_featured_image',
'default' => 'no', 'default' => 'no',
'type' => 'checkbox', 'type' => 'checkbox',
'checkboxgroup' => 'end',
), ),
)), )),

View File

@@ -21,7 +21,7 @@ $defaults = array(
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false,
'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false, 'show_logos' => get_option( 'sportspress_countdown_show_logos', 'no' ) == 'yes' ? true : false,
'show_feat_image' => get_option( 'sportspress_countdown_show_featured_image', 'no' ) == 'yes' ? true : false, 'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false,
); );
if ( isset( $id ) ): if ( isset( $id ) ):
$post = get_post( $id ); $post = get_post( $id );
@@ -77,10 +77,10 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
<div class="sp-template sp-template-countdown"> <div class="sp-template sp-template-countdown">
<div class="sp-countdown-wrapper"> <div class="sp-countdown-wrapper">
<?php <?php
if ( $show_feat_image && has_post_thumbnail( $post ) ) { if ( $show_thumbnail && has_post_thumbnail( $post ) ) {
?> ?>
<h2 class="event-name sp-event-name"> <div class="event-image sp-event-image">
<?php echo get_the_post_thumbnail( $post ); ?> <?php echo get_the_post_thumbnail( $post ); ?>
</h2> </h2>
<?php } ?> <?php } ?>
<h3 class="event-name sp-event-name"> <h3 class="event-name sp-event-name">