Fix event results display
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
function sportspress_post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
|
||||
if( empty ( $html ) && in_array( get_post_type( $post_id ), array( 'sp_team', 'sp_tournament' ) ) ) {
|
||||
if( empty ( $html ) && get_post_type( $post_id ) == 'sp_team' ) {
|
||||
$parents = get_post_ancestors( $post_id );
|
||||
foreach ( $parents as $parent ) {
|
||||
if( has_post_thumbnail( $parent ) ) {
|
||||
|
||||
@@ -13,10 +13,12 @@ function sportspress_default_event_content( $content ) {
|
||||
$results = sportspress_event_results();
|
||||
$players = sportspress_event_players();
|
||||
$staff = sportspress_event_staff();
|
||||
if ( is_array( $results ) && array_filter( $results, 'array_filter' ) )
|
||||
return $results . $details . $players . $staff . $content;
|
||||
$venue = sportspress_event_venue();
|
||||
$content = $details . $venue . $players . $staff . $content;
|
||||
if ( $results ):
|
||||
$content = $results . $details . $players . $staff . $content;
|
||||
else:
|
||||
$venue = sportspress_event_venue();
|
||||
$content = $details . $venue . $players . $staff . $content;
|
||||
endif;
|
||||
endif;
|
||||
return $content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user