<?php
	$post_type = 'excursii';
	
	$args_new = array(
		'number' => 3,
		'taxonomy' => 'destinatii',
		'hide_empty' => true,
		/*'orderby' => 'menu_order',
		'order' => 'DESC',*/
		'meta_query' => array(
			array(
				'key'     => 'destinatie_ascunde',
				'value'   => '1',
				'compare' => '!=',
			),
		),
	);
	
	$myposts = get_terms( $args_new );
	
	if ( ! empty( $myposts ) && ! is_wp_error( $myposts ) ){ 
?>
<div class="row excursii-shortcode">
	
	<?php  foreach ( $myposts as $mypost ) {
		$urlThumb = get_field('destinatie_thumb', 'destinatii_'.$mypost->term_id ); 
		
		
	?>
		<div class="col-md-4 col-sm-6 col-xs-12 excursie excursie-shrotcode margin-bottom">
			<a href="<?php echo get_term_link($mypost->term_id); ?>" class="excursie-prezentare" >
				<span class="thumb">
					<span style="background-image: url('<?php echo $urlThumb; ?>');">
					</span>
				</span>
				<span class="excursie-prezentare-content">
					<span class="display-table">
						<span class="display-table-cell">
							
							<?php 
								$excursieTerm = wp_get_post_terms( get_the_ID(), 'destinatii' )[0]->name; 
							?>
							<span class="term">
								<span>
									<?php echo $excursieTerm; ?>
								</span>
							</span>
						</span>
					</span>
				</span>
			</a>
			<h2><?php echo $mypost->name; ?></h2>
			
		</div>
		
	<?php } ?>
</div>
<?php } ?>	
	                