Support

Home Forums Event Espresso Premium Categorized events effected by update

Categorized events effected by update

Posted: November 4, 2016 at 8:25 am

Viewing 11 reply threads


PAI Editor

November 4, 2016 at 8:25 am

Hi,

I just updated to the latest release this morning, and now all of the different listings of events (eg https://www.pai.ie/leadership-management/) are showing old, expired events as coming up next week? And showing multiple on the same day.

Thanks


Lorenzo Orlando Caum

  • Support Staff

November 4, 2016 at 11:02 am

Hello,

I took a look at the page that you shared and I see an event for November 4 (today) and then upcoming events for November 10.

Where are you seeing the mix of past and current events?


Lorenzo


PAI Editor

November 4, 2016 at 11:23 am

Hi,

Sorry, on this page https://www.pai.ie/legal-regulatory-public-policy/

This is what is appearing for me: https://i0.wp.com/www.pai.ie/wp-content/uploads/2016/11/error.png?ssl=1

Thanks


Lorenzo Orlando Caum

  • Support Staff

November 4, 2016 at 12:10 pm

Hello,

The new link that you shared also shows upcoming events. In this case, I see upcoming events for mid-November and the end of November:

https://cl.ly/3u1S1F0g2l2w/Image%202016-11-04%20at%202.08.31%20PM.png

Where are you seeing old events? And could you confirm that an old event is on that has taken place already?


Lorenzo


PAI Editor

November 10, 2016 at 1:52 am

The issue is that events that have expired (for example, the event in that pic entitled “PAI Masterclass in Protected Disclosures”) but they are all showing up as November 17 (or some other date on which they are not taking place). We only have 2 events taking place on November 17, but that pic shows 10 events on that date.


Tony

  • Support Staff

November 10, 2016 at 5:49 am

Hmm, strange.

How are you pulling those events in on those pages?


PAI Editor

November 10, 2016 at 5:53 am

They are custom taxonomies based on our event categories.


Tony

  • Support Staff

November 10, 2016 at 6:29 am

Yes, but how are you pulling the events in to display them on the page?

For example are you using a shortcode or a custom query?


PAI Editor

November 10, 2016 at 6:54 am

Oh, sorry. I didn’t actually build these pages, so I’m not entirely sure. Each of the category pages has the Template set as “Event Pages”.

The content of which is

<?php
/**
*Template Name: Events
*/
?>
<?php get_header(); ?>
<div class=”events-template”>
<?php
if (have_posts()) : while (have_posts()) : the_post();
the_content();
endwhile; endif; ?>
<?php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$args = array(
‘post_type’ => ‘espresso_events’,
‘posts_per_page’ => 10,
‘paged’ => $paged,
‘order’ => ‘DESC’
);
query_posts($args);
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class=”post-item”>
<div class=’content’>
<?php
if ( has_post_thumbnail() ) : ?>
‘>
<span><?php the_post_thumbnail(‘thumbnail’); ?></span>
<?php
echo “
“;
endif ;
?>
<div class=”news-content”>
“><?php the_title(); ?>
<div class=”post-date”>
<?php the_time(‘F j, Y’); ?>
</div>
” class=”read-more”>MORE
</div>
<div class=”clearfix”></div>
</div>
</article>
<?php
endwhile;
if(function_exists(‘wp_pagenavi’)) {
wp_pagenavi();
}
// Reset Query
wp_reset_query();

endif; ?>
</section>
</div>
</div>
<?php get_footer(); ?>


Josh

  • Support Staff

November 10, 2016 at 9:32 am

The code is doing exactly what it’s being asked to do, show all events regardless of whether they’ve expired or not. An update to Event Espresso wouldn’t affect that code.


PAI Editor

November 10, 2016 at 9:47 am

The reason I had assumed it was because of the update was because it did not look, organise, or show things like this until after I did the update at the end of last week.

Is there a way I can change the code to show only events that are upcoming, and make sure they appear with the correct date?


Josh

  • Support Staff

November 10, 2016 at 10:04 am

The person that actually built those pages should probably make those corrections, but I can point you to an example of where something that can be corrected. This part here:

<div class=”post-date”>
<?php the_time(‘F j, Y’); ?>
</div>

That’s basically telling WordPress to display the date that the post was created, because it’s using the the_time() function, which is documented here:
https://codex.wordpress.org/Function_Reference/the_time

Viewing 11 reply threads

The support post ‘Categorized events effected by update’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso