Add option to display venue in event blocks close #90
This commit is contained in:
@@ -246,6 +246,14 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_event_blocks_show_season',
|
'id' => 'sportspress_event_blocks_show_season',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Display venue', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_blocks_show_venue',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => 'end',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ $defaults = array(
|
|||||||
'show_all_events_link' => false,
|
'show_all_events_link' => false,
|
||||||
'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,
|
'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,
|
||||||
'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,
|
'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,
|
||||||
|
'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
extract( $defaults, EXTR_SKIP );
|
extract( $defaults, EXTR_SKIP );
|
||||||
@@ -114,6 +115,9 @@ if ( $id ) {
|
|||||||
<?php if ( $show_season ): $seasons = get_the_terms( $event, 'sp_season' ); if ( $seasons ): $season = array_shift( $seasons ); ?>
|
<?php if ( $show_season ): $seasons = get_the_terms( $event, 'sp_season' ); if ( $seasons ): $season = array_shift( $seasons ); ?>
|
||||||
<div class="event-season"><?php echo $season->name; ?></div>
|
<div class="event-season"><?php echo $season->name; ?></div>
|
||||||
<?php endif; endif; ?>
|
<?php endif; endif; ?>
|
||||||
|
<?php if ( $show_venue ): $venues = get_the_terms( $event, 'sp_venue' ); if ( $venues ): $venue = array_shift( $venues ); ?>
|
||||||
|
<div class="event-venue"><?php echo $venue->name; ?></div>
|
||||||
|
<?php endif; endif; ?>
|
||||||
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user