Skip to content

Instantly share code, notes, and snippets.

@dropmeaword
Created January 30, 2012 09:54
Show Gist options
  • Save dropmeaword/1703634 to your computer and use it in GitHub Desktop.
Save dropmeaword/1703634 to your computer and use it in GitHub Desktop.
Wordpress Event Type listings
<!-- lf: begin: list agenda event -->
<?php
query_posts(array('meta_key' => 'agenda_begins', 'orderby' => 'meta_value', 'post_type' => 'event', 'showposts' => 5));
if (have_posts()):
?>
<section class="agenda">
<h1><?php _e('Upcoming events'); ?></h1>
<dl class="eventListings">
<?php while(have_posts()): the_post(); ?>
<dt><a class="eventTitle" href="<?php the_permalink() ?>"><?php the_title(); ?></a></dt>
<dd><?php echo get('agenda_begins'); echo'___'; echo get('agenda_ends'); echo '&nbsp;&nbsp;'; echo get('venue_name'); ?></dd>
<dd>
<?php echo preg_replace('/<p>(.+?)<\/p>/','$1',get_the_excerpt()); ?> <a href="<?php the_permalink() ?>" class="more-link"><?php _e('Read more', 'ia3'); ?><span class="implied"> &ndash; &lsquo;<?php the_title(); ?>&rsquo;</span>.</a>
</dd>
<?php endwhile; wp_reset_query(); ?>
</dl>
</section>
<?php endif; ?>
<!-- lf: end: list agenda event -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment