Problem with custom template page to show all events for an Event Category

Hi,

I recently had a problem in showing all events for an event category where the all the events could be a year out into the future.

I just couldn't solve it with the short codes that were available at the time, so I switched to resolving it with a custom template, where a customized copy of the default custom template sits in the them folder, with the category slug as part of the name (taxonomy-eab_events_category-training-events.php).

While we only had 5 or less upcoming events, this has been working really well, but we just added a sixth event and the one furthest into the future has now slipped off the page.

Here's the code I'm using, and I cant see for the life of me where it is only reading the first 5 events.

Any ideas?

Thanks in advance,

Robert Ford

p.s. The page can be found at: http://174.122.174.219/~yoga/events/training-events/

<?php
global $booking, $wpdb, $wp_query;
get_header( 'event' );
?>
<div id="training-template-header">
<h2>Level I Teacher Intensive</h2>
This training program qualifies yoga teachers to safely and effectively impart rigorously researched yoga practices, with individually-tailored modifications, to those with arthritis and its related conditions.

Yoga teachers who successfully complete this course will receive a certificate of completion, student and teacher manuals for implementing Yoga for Arthritis, a 16-class structure, in their local communities and access to an online community devoted to Yoga for Arthritis intensive graduates. Completion also qualifies a participant for up to 30 hours of Yoga Alliance credit.</br></br>
<h2>Refresher Course</h2>
The Level I Course is a prerequisite for this course. After you complete your first refresher course, you are eligible to be a Certified Yoga for Arthritis teacher.  Certified teachers must stay current by attending a refresher course every 3 years.</br></br>
</div>

<div id="content-area" class="clearfix">
<div id="left-area">
<?php get_template_part('includes/breadcrumbs', 'page'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('entry clearfix'); ?>>
<?php
$thumb = '';
$width = apply_filters('et_blog_image_width',630);
$height = apply_filters('et_blog_image_height',210);
$classtext = '';
$titletext = get_the_title();
$thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Singleimage');
$thumb = $thumbnail["thumb"];
?>
<?php if ( '' != $thumb && 'on' == et_get_option('lucid_page_thumbnails') ) { ?>
<div class="post-thumbnail">
<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
</div> <!-- end .post-thumbnail -->
<?php } ?>

<div class="post_content clearfix">
<h4 class="title"><?php the_title(); ?></h4>
<?php echo Eab_Template::get_event_details($post); ?>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<p>'.esc_attr__('Pages','Lucid').': ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php edit_post_link(esc_attr__('Edit this page','Lucid')); ?>
</div> <!-- end .post_content -->
</article> <!-- end .entry -->
<?php endwhile; // end of the loop. ?>
<?php if ( 'on' == et_get_option('lucid_show_pagescomments') ) comments_template('', true); ?>

</div> <!-- end #left-area -->
<?php if ( 'on' != $et_full_post ) get_sidebar(); ?>
</div> <!-- end #content-area -->
<?php get_footer( 'event' ); ?>

  • aecnu
    • WP Unicorn

    Greetings Robert,

    Not having any coders on the support team staff has definitely got us in another pickle and the need of a coder to possibly comment on it though we do not support custom coding - though I will help when I can in any event.

    Therefore I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • fordrm
    • Site Builder, Child of Zeus

    Thanks Joe!

    I always hate custom coding too, but I ended up going this way because of the limitations of the shortcodes.

    I know that they've been upgraded recently, so I'm going to create a test environment, and see if what I want to do is now possible with the shortcodes.

    Robert

  • fordrm
    • Site Builder, Child of Zeus

    Hi Joe,

    I just wanted to let you know that I've been doing some more testing, and this problem isn't just with custom coded templates.

    I added a new category called 'test' and then added 7 new events, one on the first of each month from February to August.

    If I use the following URL to pull up all of the events for the 'test category, I 'm only seeing the first 5 events.

    http://174.122.174.219/~yoga/events/test/

    Any ideas?

    Robert

  • fordrm
    • Site Builder, Child of Zeus

    Hi,

    Just checking back in on this one... anyone have ideas on whether this 5 event limitation is to do with the plugin, or the underlying WP functionality? I'm hoping that someone can come up with a suggestion on coding for pagination if there is more than 5.

    Thanks in advance,

    Robert

  • Patrick
    • Support Monkey

    Hiya @fordrm

    Yes, that would be a limitation in the shortcode. But you can increase that by using the lookahead and weeks parameters. This example will show all events for the next 52 weeks in the category "second":

    [eab_archive category="second" lookahead="1" weeks="52"]

    I don't see a way to paginate the results from the shortcode though.

    But, if all events are in the same category, you can simply create a custom link in your menu to the category URL. Then, under "Settings" > "Reading", set "Blog pages show at most" to however many you want displayed per page, and WordPress will automatically paginate the results for you :slight_smile:

  • fordrm
    • Site Builder, Child of Zeus

    Hi Patrick,

    For some unknown reason (plug-in clash, etc.), I can't get the event short codes to work on this site.

    I tried your other suggestion about changing the number of blog entries to show, but that doesn't work when you're using a custom link to show all blogs for a category. I think that it will only work for the blog posts that are automatically showing on the home page.

    http://yoga4arthritis.com

    I guess that I still have the same outstanding question. Is the lack of pagination down to the plugin, or is it something lacking from core WP? If it is the plugin, is that on the list of things to be worked on?

    Thanks in advance,

    Robert

  • Vladislav
    • Dead Eye Dev

    Hello,

    Just to update - paging is actually one of the big subjects for the next feature plugin release (both template helpers and for shortcode output). In the meanwhile, Patrick's method should work well to control the limits for archives, including Events.

  • Patrick
    • Support Monkey

    @Vladislav

    Looking forward to the next update!

    @fordrm

    You're welcome!

    I'm going to go ahead and mark this thread as resolved for now. If you still need more help on this, simply re-open the thread by ticking the Mark as Not Resolved (re-open) box below.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.