Advertisement
Guest User

Untitled

a guest
Mar 13th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <?php
  2. /**
  3. *The template used for displaying content in three column page.php
  4. */
  5. ?>
  6. <div class="article wrap">
  7. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  8. <div class="entry-content">
  9. <?php the_content(); ?>
  10.  
  11. <h3>Upcoming Events</h3>
  12. <?php
  13. $upcoming_args = array (
  14. 'post-type' => 'events',
  15. 'orderby' => 'meta-value',
  16. 'order' => 'ASC',
  17. 'posts_per_page' => -1,
  18. 'meta_key' => 'ecpt_date',
  19. 'meta_value' => time(),
  20. 'meta_compare' => '>='
  21. );
  22. $upcoming_events = get_posts($upcoming_args);
  23. if($upcoming_events) {
  24. echo '<ul>';
  25. foreach($upcoming_events as $event) {
  26. echo '<li><a href="' . get_permalink($event->ID) . '">' . get_the_title($event->ID) . '</a></li>;
  27. }
  28. echo '</ul>';
  29. }
  30. ?>
  31.  
  32. <h3>Past Events</h3>
  33. <?php
  34. $past_args = array (
  35. 'post-type' => 'events',
  36. 'orderby' => 'meta-value',
  37. 'order' => 'DESC',
  38. 'posts_per_page' => -1,
  39. 'meta_key' => 'ecpt_date',
  40. 'meta_value' => time(),
  41. 'meta_compare' => '<'
  42. );
  43. $past_events = get_posts($past_args);
  44. if($past_events) {
  45. echo '<ul>';
  46. foreach($upcoming_events as $event) {
  47. echo '<li><a href="' . get_permalink($event->ID) . '">' . get_the_title($event->ID) . '</a></li>;
  48. }
  49. echo '</ul>';
  50. }
  51.  
  52. ?>
  53.  
  54.  
  55. <?php wp_link_pages( array( 'before' => '<div class="page-link"> .( 'Pages:', TB_GETTEXT-DOMAIN ), 'after' => '</div> ) ); ?>
  56. <?php edit_post_link( __( 'Edit', TB_GETTEXT_DOMAIN ), '<span class="edit-link">', '</span>'; ?>
  57. </div><!-- .entry-content -->
  58. </article><!-- #post-<php the_ID(); ?> -->
  59. </div><!-- .article-wrap (end) -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement