Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *The template used for displaying content in three column page.php
- */
- ?>
- <div class="article wrap">
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <div class="entry-content">
- <?php the_content(); ?>
- <h3>Upcoming Events</h3>
- <?php
- $upcoming_args = array (
- 'post-type' => 'events',
- 'orderby' => 'meta-value',
- 'order' => 'ASC',
- 'posts_per_page' => -1,
- 'meta_key' => 'ecpt_date',
- 'meta_value' => time(),
- 'meta_compare' => '>='
- );
- $upcoming_events = get_posts($upcoming_args);
- if($upcoming_events) {
- echo '<ul>';
- foreach($upcoming_events as $event) {
- echo '<li><a href="' . get_permalink($event->ID) . '">' . get_the_title($event->ID) . '</a></li>;
- }
- echo '</ul>';
- }
- ?>
- <h3>Past Events</h3>
- <?php
- $past_args = array (
- 'post-type' => 'events',
- 'orderby' => 'meta-value',
- 'order' => 'DESC',
- 'posts_per_page' => -1,
- 'meta_key' => 'ecpt_date',
- 'meta_value' => time(),
- 'meta_compare' => '<'
- );
- $past_events = get_posts($past_args);
- if($past_events) {
- echo '<ul>';
- foreach($upcoming_events as $event) {
- echo '<li><a href="' . get_permalink($event->ID) . '">' . get_the_title($event->ID) . '</a></li>;
- }
- echo '</ul>';
- }
- ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-link"> .( 'Pages:', TB_GETTEXT-DOMAIN ), 'after' => '</div> ) ); ?>
- <?php edit_post_link( __( 'Edit', TB_GETTEXT_DOMAIN ), '<span class="edit-link">', '</span>'; ?>
- </div><!-- .entry-content -->
- </article><!-- #post-<php the_ID(); ?> -->
- </div><!-- .article-wrap (end) -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement