"Group by series" ignored in template?

WordPress Event Management, Calendars & Registration Forums General Question "Group by series" ignored in template?

This topic contains 5 replies, has 2 voices, and was last updated by  Adam Abrams 10 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15208

    Hi Stephen! I’m attempting to set up a custom page to just show one event category; so am using a custom template for the first time with Event Organizer. I’m using the solution given here:

    https://gist.github.com/stephenh1988/4165380

    But I find that – even though I have

    group_events_by=”series”

    as part of my shortcode… ALL events of a series are being listed on my template.

    Any suggestions as to why this might be?

    Here’s the relevant part of my template code:

    //Get upcoming
    $events = eo_get_events(array(
         'event_start_after'=>'today',
         'showpastevents'=>false,//Will be deprecated, but set it to true to play it safe.
      ));
    
    if( $events ){
        global $post;
        echo '
      '; foreach( $events as $post ){ setup_postdata($post); ?>
    • '> <h5><?php the_title(); ?></h5> on <?php eo_get_the_start('jS F Y'); ?>

      <?php the_excerpt(); ?>

    • <?php } echo '
    '; wp_reset_postdata(); }else{ echo 'No Upcoming Events'; } ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'woothemes' ), 'after' => '</div>' ) ); ?> </section><!-- /.entry -->

    Thanks!
    adam

    Adam Abrams
    #15209

    I notice that there is an argument for the loop to limit to a specific category, so the first part of my shortcode seems unnecessary:

    [eo_events event_category="day-long-mini-retreat" group_events_by="series"]
    

    However I don’t see an argument listed for eo_get_events for grouping events.

    • This reply was modified 10 years ago by  Adam Abrams.
    • This reply was modified 10 years ago by  Adam Abrams.
    • This reply was modified 10 years ago by  Adam Abrams.
    • This reply was modified 10 years ago by  Adam Abrams.
    Adam Abrams
    #15221

    Hi Adam,

    If you creating a custom page template then this is entirely separate from the shortcode. If you use the shortcode then the plug-in will use shortcode-event-list.php template, so if you want to change the template, that’s the one to change (move it to your theme).

    However, if you using a page template, then what you tell the template to display it will (including the “page content” as entered in the tinyMCE editor, or not, depending on how you define the template.)

    If using the shortcode then:

     [eo_events group_events_by="series"]
    

    should work.

    If you are using the API

    $events = eo_get_events( array(
          'group_events_by' => 'series',
    ) );
    

    should also work.

    If your page content simply contains the above, then it is ignoring the page content as entered by the user (i.e. in the tinyMCE editor) – including the shortcodes, and is simply displaying the events as set in your query.

    Stephen Harris
    #15235

    Thanks Stephen!

    I think the trouble must have been that this page, which I’d expected to list all the possible arguments:

    http://codex.wp-event-organiser.com/function-eo_get_events.html

    Doesn’t list “group_events_by” as a possible argument.

    Am I missing something that would have led me to that info, or should it be added on the above page?

    At any rate, thanks again for the info!

    adam

    Adam Abrams
    #15238

    Yes, you’re right, it should be listed there. I’ll update the codex.

    Stephen Harris
    #15241

    Thanks!

    Adam Abrams
Viewing 6 posts - 1 through 6 (of 6 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.