<?php
 
$args=array(
    'post_type' => 'centros',
    'order'  =>  "ASC",
    'orderby'  =>  "menu_order",
    'post_status' => 'publish',
    );
query_posts($args);

?>


<div class ="center-list">
    <div class="container">
        <?php while (have_posts()) : the_post();
            
            $location = get_field('city');
            $ages = get_field('ages');
            $img = get_field('image');
        ?>
        <div class = "box-school">
            <div class="img-school">
                <img src = "<?php if($img) echo $img ?>" alt="No hay imagen">
            </div>
            <div class="info-school">
                <div class = "school-title">
                    <span><?php the_title() ?></span>
                </div>
                <div class = "location">
                    <i class="fa fa-map-marker" aria-hidden="true"></i>
                    <span><?php if($location) echo $location ?></span>
                </div>
                <div class = "age">
                    <i class="fa fa-users" aria-hidden="true"></i>
                    <span><?php if($ages) echo $ages ?></span>
                </div>
                <div class = "link">
                    <a href="<?php the_permalink();?>" target="new">Ver más</a>
                </div>
            </div>
        </div>
        <?php endwhile;?>
    </div>
</div>