Support » Plugin: The Events Calendar » [Plugin: The Events Calendar] showing all or past events?

  • How can I show a list of my past events, or rather all the events? This is the code i’m currently using:

    <?php query_posts($query_string . '&category_name=events'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<?php if(the_event_start_date(null, false, mdY) >= date(mdY)) : ?>
    		<li class="event">
    			<?php if ( is_new_event_day() ) : ?><h4 class="event-day"><?php echo the_event_start_date( null, false ); ?></h4><?php endif; ?>
    			<div class="event-content">
    				<?php the_title('<h2 class="event-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
    
    				<?php the_excerpt() ?>
    			</div>
    		</li>
    	<?php endif; ?>
    <?php endwhile; else: ?>
    	<p>No Events</p>
    <?php endif; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • anyone?

    at all?

    Hi There

    Try deleting this line:

    <?php if(the_event_start_date(null, false, mdY) >= date(mdY)) : ?>

    I seemed to work for me. I was using your code and trying to figure out how to list more than 2 events on my homepage here: http://darwinhub.com/

    Do you know how I could list more than 2 events? here is my code…

    <?php query_posts($query_string . '&category_name=events&showposts=5'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<?php if(the_event_start_date(null, false, mdY) >= date(mdY)) : ?>
    		<ul>
    			<div class="event-content">
    				<?php the_title('<div class="event-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></div>'); ?>
                    <?php if ( is_new_event_day() ) : ?><div class="event-day"><?php echo the_event_start_date( null, false ); ?></div><?php endif; ?>
    			</div>
    		</ul>
    	<?php endif; ?>
    <?php endwhile; else: ?>
    	<p>Sorry, no events list. Got events coming up? List an event here.</p>
    <?php endif; ?>

    Thanks!

    Not sure…

    I did delete the line you suggested though, and now it shows the only two events that are listed as “ongoing”, but still not all of them.

    this is the code:

    <?php query_posts($query_string . '&category_name=events'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<?php if(the_event_start_date(null, false, mdY) >= date(mdY)) : ?>
    		<li class="event">
    			<?php if ( is_new_event_day() ) : ?><h4 class="event-day"><?php echo the_event_start_date( null, false ); ?></h4><?php endif; ?>
    			<div class="event-content">
    				<?php the_title('<h2 class="event-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?>
    
    				<?php the_excerpt() ?>
    			</div>
    		</li>
    	<?php endif; ?>
    <?php endwhile; else: ?>
    	<p>No Events</p>
    <?php endif; ?>

    any ideas on how i can get ALL my old events to show up?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: The Events Calendar] showing all or past events?’ is closed to new replies.