?>
</span>
					<?php 
if (!empty($match_options['away-flag'])) {
    ?>
						<span class="gdlr-team-flag"><?php 
    echo gdlr_get_image($match_options['away-flag']);
    ?>
</span>
					<?php 
}
?>
				</div>
				<div class="gdlr-soccer-match-results-info">
					<?php 
echo gdlr_soccer_get_match_info($match_options);
?>
				</div>
			</div>
		</div>
	</div>
	
	<!-- start content -->
	<div class="with-sidebar-wrapper">
		<div class="with-sidebar-container container">
			<div class="with-sidebar-left <?php 
echo $gdlr_sidebar['outer'];
?>
 columns">
				<div class="with-sidebar-content <?php 
echo $gdlr_sidebar['center'];
function gdlr_print_upcoming_match_item($settings)
{
    $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
    global $gdlr_spaces;
    $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
    if (!empty($settings['image-id'])) {
        $image_url = is_numeric($settings['image-id']) ? wp_get_attachment_url($settings['image-id']) : $settings['image-id'];
        $margin .= ' background-image: url(\'' . $image_url . '\'); ';
    }
    $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
    $current_date = date_i18n('Y-m-d H:i', current_time('timestamp'));
    // query posts section
    $args = array('post_type' => 'fixture_and_result', 'suppress_filters' => false);
    $args['posts_per_page'] = 1;
    $args['meta_key'] = 'gdlr-start-date';
    $args['orderby'] = 'meta_value';
    $args['order'] = 'asc';
    $args['paged'] = 1;
    $args['meta_query'] = array(array('key' => 'gdlr-start-date', 'value' => $current_date, 'compare' => '>'));
    if (!empty($settings['category'])) {
        $args['tax_query'] = array();
        if (!empty($settings['category'])) {
            array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'result_category', 'field' => 'slug'));
        }
    }
    $query = new WP_Query($args);
    while ($query->have_posts()) {
        $query->the_post();
        $match_val = gdlr_lms_decode_preventslashes(get_post_meta(get_the_ID(), 'gdlr-soccer-fixture-result-settings', true));
        $match_options = empty($match_val) ? array() : json_decode($match_val, true);
        echo '<div class="upcoming-match-item-wrapper gdlr-item" ' . $item_id . $margin_style . ' >';
        echo '<div class="upcoming-match-overlay"></div>';
        echo '<div class="gdlr-upcoming-match-team-wrapper">';
        echo '<span class="gdlr-upcoming-match-team gdlr-left">';
        echo empty($match_options['home-flag']) ? '' : '<span class="gdlr-team-flag">' . gdlr_get_image($match_options['home-flag']) . '</span>';
        echo $match_options['home'] . '</span>';
        echo '<span class="gdlr-upcoming-match-versus">' . __('VS', 'gdlr-soccer') . '</span>';
        echo '<span class="gdlr-upcoming-match-team gdlr-right">' . $match_options['away'];
        echo empty($match_options['away-flag']) ? '' : '<span class="gdlr-team-flag">' . gdlr_get_image($match_options['away-flag']) . '</span>';
        echo '</span>';
        echo '</div>';
        // upcoming-match-team
        echo gdlr_soccer_get_match_info($match_options, '<span class="upcoming-match-info-overlay"></span>');
        echo '</div>';
    }
    wp_reset_postdata();
}