Add events list template

This commit is contained in:
Brian Miyaji
2014-03-17 19:12:12 +11:00
parent a7eb732933
commit e39b938d6e
12 changed files with 286 additions and 26 deletions

View File

@@ -13,16 +13,42 @@ function sportspress_default_event_content( $content ) {
$results = sportspress_event_results();
$players = sportspress_event_players();
$staff = sportspress_event_staff();
$id = get_the_ID();
$video_url = get_post_meta( $id, 'sp_video', true );
if ( $video_url ):
global $wp_embed;
$video = $wp_embed->autoembed( $video_url );
else:
$video = '';
endif;
if ( $results ):
$content = $results . $details . $players . $staff . $content;
$content = $video . $results . $details . $players . $staff . $content;
else:
$venue = sportspress_event_venue();
$content = $details . $venue . $players . $staff . $content;
$content = $video . $details . $venue . $players . $staff . $content;
endif;
endif;
return $content;
}
add_filter( 'the_content', 'sportspress_default_event_content' );
add_filter( 'the_content', 'sportspress_default_event_content', 7 );
function sportspress_default_calendar_content( $content ) {
if ( is_singular( 'sp_calendar' ) && in_the_loop() ):
$id = get_the_ID();
$format = get_post_meta( $id, 'sp_format', true );
switch ( $format ):
case 'list':
$calendar = sportspress_events_list( $id );
break;
default:
$calendar = sportspress_events_calendar( $id, true, false );
break;
endswitch;
$content = $calendar . $content;
endif;
return $content;
}
add_filter( 'the_content', 'sportspress_default_calendar_content' );
function sportspress_default_team_content( $content ) {
if ( is_singular( 'sp_team' ) && in_the_loop() ):