?AlkantarClanX12

Your IP : 216.73.217.134


Current Path : /home/rankinh/saintgilleslesbains-bis/wp-content/themes/divi-child/
Upload File :
Current File : /home/rankinh/saintgilleslesbains-bis/wp-content/themes/divi-child/archive-sglb_event.php

<?php get_header(); ?>

<div id="main-content">
    
    <section class="sglb-event-archive-hero">
        <div class="container">
            <h1>L'Agenda de Saint-Gilles</h1>
            <p>Retrouvez tous les concerts, spectacles et événements de la station balnéaire.</p>
        </div>
    </section>

    <div class="container">
        <div class="sglb-event-grid">
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); 
                $post_id = get_the_ID();
                
                // Récupération des metas
                $date_start = get_post_meta($post_id, '_sglb_event_date_start', true);
                $time_start = get_post_meta($post_id, '_sglb_event_time_start', true);
                $time_end   = get_post_meta($post_id, '_sglb_event_time_end', true);
                $linked_id  = get_post_meta($post_id, '_sglb_event_linked_listing', true);
                $location   = $linked_id ? get_the_title($linked_id) : 'Lieu à venir';
                
                // Catégorie pour le badge
                $categories = get_the_terms($post_id, 'sglb_event_cat');
                $cat_name = $categories ? $categories[0]->name : 'Événement';
            ?>

                <article class="sglb-event-card">
                    <a href="<?php the_permalink(); ?>" class="card-link">
                        <div class="card-image">
                            <?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium_large'); } ?>
                            <span class="card-badge"><?php echo esc_html($cat_name); ?></span>
                            
                        </div>
                        
                        <div class="card-content">
                            <h2 class="card-title"><?php the_title(); ?></h2>
                            
                            <div class="card-time-row">
                                <span class="card-date">
                                    <?php echo $date_start ? date_i18n('j F', strtotime($date_start)) : ''; ?>
                                </span>
                                <span class="card-hours">
                                    <?php echo esc_html($time_start); ?> • <?php echo esc_html($time_end); ?>
                                </span>
                            </div>
                            
                            <p class="card-location"><?php echo esc_html($location); ?></p>
                        </div>
                    </a>
                </article>

            <?php endwhile; endif; ?>
        </div>
        
        <div class="sglb-pagination">
            <?php echo paginate_links(); ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>