Add Events widget

This commit is contained in:
Brian Miyaji
2014-02-03 05:51:09 +11:00
parent eca5c08d16
commit 39d7bbac7f
18 changed files with 323 additions and 30 deletions

View File

@@ -17,19 +17,23 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
$seasons = get_the_terms( $id, 'sp_season' );
$terms = array();
if ( sizeof( $leagues ) ):
if ( $leagues ):
$league = reset( $leagues );
$terms[] = $league->name;
endif;
if ( sizeof( $seasons ) ):
if ( $seasons ):
$season = reset( $seasons );
$terms[] = $season->name;
endif;
$title = sizeof( $terms ) ? implode( ' — ', $terms ) : get_the_title( $id );
$output = '<h4 class="sp-table-caption">' . $title . '</h4>' .
'<div class="sp-table-wrapper">' .
if ( ! is_singular( 'sp_table' ) )
$output = '<h4 class="sp-table-caption"><a href="' . get_permalink( $id ) . '">' . $title . '</a></h4>';
else
$output = '<h4 class="sp-table-caption">' . $title . '</h4>';
$output .= '<div class="sp-table-wrapper">' .
'<table class="sp-league-table sp-data-table sp-responsive-table">' . '<thead>' . '<tr>';
$data = sportspress_get_league_table_data( $id );