Event list by month

This topic contains 6 replies, has 2 voices, and was last updated by  Stephen Harris 8 years, 10 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22664

    Hi,
    I would like to have the event lists but separated by month:
    that is
    April
    -event 1
    -event 2
    May
    -event3
    -event1

    etc
    instead of just listing event titles and dates. is that possible?

    Gabriela Halac
    #22672

    Hi Gabriela,

    There is a template file in event-organiser/templates, event-list-shortcode.php. You can copy that your theme and edit it there. (There is a similarly named template for widgets).

    This thread contains an example of that template edited to group by month.

    Stephen Harris
    #22673

    Also, your site will already have pages listing events on any given month (see https://wordpress.org/support/topic/group-events-by-month-archive-eventphp for details)

    Stephen Harris
    #22751

    Hi,
    I tried this approach and it worked but it is showing me past events.
    this is my template I just noticed this now that I am loading the dates and the real data.

                    <?php while ( have_posts() ) : the_post();?>
    
    
                    <?php 
            if( $current_month != eo_get_the_start('m') ){
    
                    //End previous group
                    echo '';
                    //Start new group
                    echo '<div class="mes-agenda">'.eo_get_the_start('F Y').'</div>';
                    echo '';
            }
            $current_month = eo_get_the_start('m');
    
            //Generate HTML classes for this event
            $eo_event_classes = eo_get_event_classes(); 
    
            //For non-all-day events, include time format
            $format = ( eo_is_all_day() ? $date_format : $date_format. '--' .$time_format );
            ?>
    
    
    
    
    
    
    
                    <div class="row">
    

    <div class=”col-xs-3 col-sm-2″>

         &lt;div class="dia-agenda"&gt;
       &lt;?php 
            echo eo_format_event_occurrence( $post-&gt;ID, $post-&gt;occurrence_id, 'd \d\e F', ' ', ' - ', true );
    
    
    
            ?&gt;
        &lt;/div&gt;
    
    
        &lt;/div&gt;
    
        <div class="col-xs-6 col-sm-2">
        <div class="hora-agenda">
       <?php 
    
            echo eo_format_event_occurrence( $post->ID, $post->occurrence_id, ' ', 'H:s \h\s', ' - ', true );
    
    
            ?>
        </div>
    
        </div>
        <div class="col-xs-12 col-md-6">
    
         <div class="evento-agenda">
       " ><?php the_title() ?>
            
        </div>
    
        </div>
        <div class="col-xs-2" style="text-align:right">#reservas" class="section-scroll btn btn-border-w btn-round">Reservas</div>
    
    
    
                </div>
    
    
                    <?php   endwhile; ?>
    
    Gabriela Halac
    #22752

    Is this the list created by the shortcode or the widget?

    Stephen Harris
    #22756

    HI, I need to make a new post and even I login I can’t write a new post on the forums.
    I am having trouble with this:

    $next = eo_get_next_occurrence_of();
    if( $next ){
    $start = $next[‘start’];
    echo $start->format(‘d \d\e F H:s \h\s’);
    }

    the month is not localized Spanish, that is only on the front page, in other pages it works.

    Gabriela Halac
    #22768

    Hi Gabriela,

    That’s odd, you should be able to open new topics here: http://wp-event-organiser.com/forums/forum/general-question/

    The format method for DateTime doesn’t provide translations. Instead you would have to use the eo_format_datetime() function (codex):

    //echo $start->format(‘d \d\e F H:s \h\s’);
    echo eo_format_datetime( $start, 'd \d\e F H:s \h\s' );
    
    Stephen Harris
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.