Add Featured Image support to Event Countdown widget
This commit is contained in:
@@ -88,6 +88,13 @@ class SportsPress_Countdowns {
|
|||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'title' => __( 'Featured Image', 'sportspress' ),
|
||||||
|
'desc' => __( 'Display featured image of event', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_countdown_show_featured_image',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
)),
|
)),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -21,6 +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,
|
||||||
);
|
);
|
||||||
if ( isset( $id ) ):
|
if ( isset( $id ) ):
|
||||||
$post = get_post( $id );
|
$post = get_post( $id );
|
||||||
@@ -75,6 +76,13 @@ 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
|
||||||
|
if ( $show_feat_image && has_post_thumbnail( $post ) ) {
|
||||||
|
?>
|
||||||
|
<h2 class="event-name sp-event-name">
|
||||||
|
<?php echo get_the_post_thumbnail( $post ); ?>
|
||||||
|
</h2>
|
||||||
|
<?php } ?>
|
||||||
<h3 class="event-name sp-event-name">
|
<h3 class="event-name sp-event-name">
|
||||||
<?php
|
<?php
|
||||||
if ( $show_logos ) {
|
if ( $show_logos ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user