<?php
$currentDate = date('Ymd');
$args = array(
'post_type' => 'users',
'posts_per_page' => -1,
'meta_key' => 'new_user_birthday',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'new_user_birthday',
'compare' => '>=',
),
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $post; ?>
<?php
$user_birthday = get_field('new_user_birthday');
$user_month = explode("/", $user_birthday);
$today_month = date("m");
?>
<?php if($today_month == $user_month[1]) {?>
<div class="birthdays_item">
<a href="/account/?user=<?php echo get_field('id_my_user'); ?>">
<div class="birthdays_item__img"><?php the_post_thumbnail('medium'); ?></div>
<div class="birthdays_item__info">
<div class="birthdays_item__date"><?php echo $user_birthday; ?></div>
<div class="birthdays_item__name"><?php the_title(); ?></div>
</div>
</a>
</div>
<?php } ?>
<?php
endwhile;wp_reset_query();
?>
<!--
<div class="birthdays_item">
<a href="#">