Support

Account

Home Forums Add-ons Repeater Field Calendar by month with date repeater Reply To: Calendar by month with date repeater

  • Hello James

    Thank you very mutch for your help. I decided to change method.

    I have created one page “calendar” with my repeater and i use relationship for the relation with my event.

    my current code is :

    <?php
    /**
     * Template Name: Test Calendrier
     */
    ?>
    
    <?php get_header(); ?>
    <div class="title-page no-thumb">
        <?php
        if( have_rows('calendrier') ) :
            while ( have_rows('calendrier') ) : 
                the_row();
                $date_debut = get_sub_field('jour_debut');
                $mois_spectacle = explode(" ", $date_debut)[1];
                
                echo '<h1>'.$mois_spectacle.'</h1>';
        ?>  
            <?php 
            $posts = get_sub_field('spectacle');
            ?>
                <?php
                foreach( $posts as $post):
                ?>
                    <?php setup_postdata($post); ?>
                    <div>
                        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                        <span>Date d├ębut : <?php echo $date_debut ?></span>
                    </div>
                <?php
                endforeach;
                ?>
            <?php wp_reset_postdata();?>
    
        <?php 
        endwhile;endif;
        ?>
    </div>
    <?php
    get_footer(); ?>

    now i must merge the month and event similar.

    but I do not know how…