<div><?php 
        echo esc_html($currency) . money_format('%!.0i', esc_html($price)) . esc_html($price_label);
        ?>
</div>
                                <?php 
    } else {
        ?>
                                <div><?php 
        echo money_format('%!.0i', esc_html($price)) . esc_html($currency) . esc_html($price_label);
        ?>
</div>
                                <?php 
    }
    ?>
                                <span><span class="icon-eye"></span> <?php 
    echo esc_html(reales_get_post_views($prop_id, ''));
    ?>
</span>
                                <?php 
    $favs = 0;
    foreach ($users as $user) {
        $user_fav = get_user_meta($user->data->ID, 'property_fav', true);
        if (is_array($user_fav) && in_array($prop_id, $user_fav)) {
            $favs = $favs + 1;
        }
    }
    ?>
                                <span><span class="icon-heart"></span> <?php 
    echo esc_html($favs);
    ?>
</span>
Example #2
0
 function reales_posts_custom_column_views($column_name, $id)
 {
     if ($column_name === 'post_views') {
         echo reales_get_post_views(get_the_ID(), '');
     }
 }