Add margin to view all links
This commit is contained in:
@@ -54,11 +54,19 @@
|
|||||||
/* Google Maps */
|
/* Google Maps */
|
||||||
.sp-google-map {
|
.sp-google-map {
|
||||||
height: 320px;
|
height: 320px;
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
}
|
||||||
.sp-google-map img {
|
.sp-google-map img {
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
}
|
}
|
||||||
|
.sp-venue-map {
|
||||||
|
margin-bottom: 4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Templates */
|
||||||
|
.sp-view-all-link {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 40em) {
|
@media only screen and (max-width: 40em) {
|
||||||
.sp-responsive-table {
|
.sp-responsive-table {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ function sportspress_default_venue_content( $query ) {
|
|||||||
$longitude = sp_array_value( $venue_meta, 'sp_longitude', null );
|
$longitude = sp_array_value( $venue_meta, 'sp_longitude', null );
|
||||||
|
|
||||||
if ( $latitude != null && $longitude != null )
|
if ( $latitude != null && $longitude != null )
|
||||||
echo '<div class="sp-google-map" data-address="' . $address . '" data-latitude="' . $latitude . '" data-longitude="' . $longitude . '"></div>';
|
echo '<div class="sp-google-map sp-venue-map" data-address="' . $address . '" data-latitude="' . $latitude . '" data-longitude="' . $longitude . '"></div>';
|
||||||
}
|
}
|
||||||
add_action( 'loop_start', 'sportspress_default_venue_content' );
|
add_action( 'loop_start', 'sportspress_default_venue_content' );
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,6 @@ if ( $pad != 0 && $pad != 7 )
|
|||||||
$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>";
|
$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>";
|
||||||
|
|
||||||
if ( $id && $show_all_events_link )
|
if ( $id && $show_all_events_link )
|
||||||
$calendar_output .= '<a class="sp-calendar-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
||||||
|
|
||||||
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
||||||
|
|||||||
@@ -134,6 +134,6 @@ extract( $defaults, EXTR_SKIP );
|
|||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
if ( $id && $show_all_events_link )
|
if ( $id && $show_all_events_link )
|
||||||
echo '<a class="sp-calendar-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all events', 'event') . '</a>';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@@ -4,25 +4,36 @@ if ( ! isset( $id ) )
|
|||||||
|
|
||||||
$venues = get_the_terms( $id, 'sp_venue' );
|
$venues = get_the_terms( $id, 'sp_venue' );
|
||||||
|
|
||||||
$output = '';
|
$show_map = get_option( 'sportspress_event_show_map', 'yes' ) == 'yes' ? true : false;
|
||||||
|
|
||||||
if ( ! $venues )
|
if ( ! $venues )
|
||||||
return $output;
|
return $output;
|
||||||
|
|
||||||
foreach( $venues as $venue ):
|
foreach( $venues as $venue ):
|
||||||
|
|
||||||
$t_id = $venue->term_id;
|
$t_id = $venue->term_id;
|
||||||
$term_meta = get_option( "taxonomy_$t_id" );
|
$term_meta = get_option( "taxonomy_$t_id" );
|
||||||
|
|
||||||
$address = sp_array_value( $term_meta, 'sp_address', '' );
|
$address = sp_array_value( $term_meta, 'sp_address', '' );
|
||||||
$latitude = sp_array_value( $term_meta, 'sp_latitude', 0 );
|
$latitude = sp_array_value( $term_meta, 'sp_latitude', 0 );
|
||||||
$longitude = sp_array_value( $term_meta, 'sp_longitude', 0 );
|
$longitude = sp_array_value( $term_meta, 'sp_longitude', 0 );
|
||||||
|
?>
|
||||||
$output .= '<h3>' . SP()->text->string('Venue', 'event') . '</h3>';
|
<h3><?php echo SP()->text->string('Venue', 'event'); ?></h3>
|
||||||
$output .= '<p><a href="' . get_term_link( $t_id, 'sp_venue' ) . '">' . $venue->name . '</a><br><small>' . $address . '</small></p>';
|
<table class="sp-data-table sp-event-venue">
|
||||||
if ( $latitude != null && $longitude != null )
|
<thead>
|
||||||
$output .= '<div class="sp-google-map" data-address="' . $address . '" data-latitude="' . $latitude . '" data-longitude="' . $longitude . '"></div>';
|
<tr>
|
||||||
|
<th><a href="<?php echo get_term_link( $t_id, 'sp_venue' ); ?>"><?php echo $venue->name; ?></a></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $address; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php if ( $show_map && $latitude != null && $longitude != null ): ?>
|
||||||
|
<tr>
|
||||||
|
<td><div class="sp-google-map" data-address="<?php echo $address; ?>" data-latitude="<?php echo $latitude; ?>" data-longitude="<?php echo $longitude; ?>"></div></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
echo apply_filters( 'sportspress_event_venue', $output );
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ endforeach;
|
|||||||
$output .= '</tbody>' . '</table>';
|
$output .= '</tbody>' . '</table>';
|
||||||
|
|
||||||
if ( $show_full_table_link )
|
if ( $show_full_table_link )
|
||||||
$output .= '<a class="sp-league-table-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table', 'team') . '</a>';
|
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View full table', 'team') . '</a>';
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,6 @@ $output .= "
|
|||||||
</div>\n";
|
</div>\n";
|
||||||
|
|
||||||
if ( $show_all_players_link )
|
if ( $show_all_players_link )
|
||||||
$output .= '<a class="sp-player-list-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
||||||
|
|
||||||
echo apply_filters( 'sportspress_player_gallery', $output );
|
echo apply_filters( 'sportspress_player_gallery', $output );
|
||||||
|
|||||||
@@ -95,6 +95,6 @@ endforeach;
|
|||||||
$output .= '</tbody>' . '</table>' . '</div>';
|
$output .= '</tbody>' . '</table>' . '</div>';
|
||||||
|
|
||||||
if ( $show_all_players_link )
|
if ( $show_all_players_link )
|
||||||
$output .= '<a class="sp-player-list-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . SP()->text->string('View all players', 'player') . '</a>';
|
||||||
|
|
||||||
echo apply_filters( 'sportspress_player_list', $output );
|
echo apply_filters( 'sportspress_player_list', $output );
|
||||||
|
|||||||
Reference in New Issue
Block a user