Advertisement
Guest User

display posts

a guest
May 11th, 2011
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <ul>
  2. <?php
  3. $temp = $wp_query;
  4. $wp_query= null;
  5. $wp_query = new WP_Query();
  6. $today = getdate();
  7. $wp_query->query('showposts=10&paged='.$paged .'&category_name=events&meta_key=dateend&day='.$today .'&order=asc&post_status=publish,future');
  8. while ($wp_query->have_posts()) : $wp_query->the_post();
  9. $finaldate = get_post_meta($post->ID,'dateend', true);
  10. $fdate = strtotime($finaldate);
  11. $displayfinaldate2 = date('l, jS F Y', $fdate);
  12. $pm = date('m');
  13. $pd = date('d');
  14. $py = date('y');
  15. if($fdate < mktime(null,null,null,$pm,$pd,$py))continue;
  16. if( $post->ID == $do_not_duplicate ) continue; ?>
  17. <li>
  18. <table width="100%" cellpadding="0" cellspacing="0">
  19. <tr>
  20. <td class="text">
  21. <h3><?php the_title(); ?></h3>
  22. <?php the_content(); ?>
  23. </td></tr></table>
  24. </li>
  25. <?php endwhile; ?>
  26.  
  27. <!-- IF THERE'S NO POST IN THE CATEGORY DIPLAY APOLOGIZE TEXT -->
  28. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  29. <?php if ( ! have_posts() ) : ?>
  30. <div class="text">
  31. <h3><?php _e( 'Apologies, but no results were found for the request.'); ?></h3></div>
  32. <?php endif; ?>
  33.  
  34. <?php if (function_exists("pagination")) {
  35. pagination($additional_loop->max_num_pages);
  36. } ?>
  37. <br />
  38. <?php $wp_query = null; $wp_query = $temp;?>
  39.  
  40. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement