Advertisement
Guest User

Untitled

a guest
Jan 24th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function page() {
  2. if (is_page('current')) {
  3. $today = date('Y-m-d');
  4. if ( have_posts() ) :
  5. // modify the query
  6. query_posts(
  7. array(
  8. 'post_type' => 'courses',
  9. 'meta_key' => 'ma_start_date',
  10. 'orderby' => 'meta_value',
  11. 'order' => 'ASC',
  12. 'posts_per_page' => -1,
  13. 'meta_query' => array(
  14. array(
  15. 'key' => 'ma_end_date',
  16. 'value' => $today,
  17. 'type' => 'date',
  18. 'compare' => '>='
  19. )
  20. )
  21. )
  22. );
  23. while ( have_posts() ) :
  24. the_post(); // init post data
  25. global $post;
  26. course_detail_box( $post, true );
  27. endwhile;
  28. else:
  29. echo "<h2>No courses are currently available for enrolment</h2>";
  30. endif;
  31. } else {
  32. thesis_loop::page();
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement