Avoid Schema error: "Missing field location"

This commit is contained in:
savvasha
2019-03-21 21:48:37 +02:00
parent 3d09397603
commit afc6936ec8
2 changed files with 13 additions and 2 deletions

View File

@@ -388,7 +388,8 @@ $identifier = uniqid( 'eventlist_' );
endif;
if ( sp_column_active( $usecolumns, 'venue' ) ):
echo '<td class="data-venue" data-label="'.__( 'Venue', 'sportspress' ).'">';
echo '<td class="data-venue" data-label="'.__( 'Venue', 'sportspress' ).'" itemprop="location" itemscope itemtype="http://schema.org/Place">';
echo '<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">';
if ( $link_venues ):
the_terms( $event->ID, 'sp_venue' );
else:
@@ -397,6 +398,13 @@ $identifier = uniqid( 'eventlist_' );
echo $venue->name;
endforeach; endif;
endif;
echo '</div>';
echo '</td>';
else:
echo '<td style="display:none;" class="data-venue" data-label="'.__( 'Venue', 'sportspress' ).'" itemprop="location" itemscope itemtype="http://schema.org/Place">';
echo '<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">';
_e( 'N/A', 'sportspress' );
echo '</div>';
echo '</td>';
endif;