Guest User

Untitled

a guest
Mar 2nd, 2011
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Template Name: Kurse
  4. */
  5. get_header();
  6.  
  7. // gets all posts next 30 days ans last 7 days
  8. function kurse_where($where = '')
  9. {
  10.     $where .= " AND post_date >= '".date('Y-m-d', strtotime('-7 days'))."'
  11.             AND post_date <= '".date('Y-m-d', strtotime('+30 days'))."' ";
  12.     return $where;
  13. }
  14. add_filter('posts_where', 'kurse_where');
  15.  
  16. // parameter: only catagorie "Kurse" and normal order: past top, future down
  17. query_posts("category_name=Kurse&order=asc");
  18.  
  19. // here the normal code like index.php to list the posts
RAW Paste Data