Advertisement
Guest User

Untitled

a guest
Jul 13th, 2011
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php $cur_y = get_the_time('Y'); ?>
  2. <?php $cur_m = get_the_time('m'); ?>
  3. <?php $off = 1; ?>
  4. <?php if($cur_m == 12) {
  5.   $next_m = 1;
  6.   $next_y = $cur_y + $offset;
  7. } elseif ($cur_m != 12) {
  8.   $next_m = $cur_m + $off;
  9.   $next_y = $cur_y;
  10. } ?>
  11.  
  12. <?php if($cur_m == 1) {
  13.   $last_m = 12;
  14.   $last_y = $cur_y - $offset;
  15. } elseif ($cur_m != 1) {
  16.   $last_m = $cur_m - $off;
  17.   $last_y = $cur_y;
  18. } ?>
  19.  
  20. <?php $prev_m = $cur_m - $off; ?>
  21. <?php $m_prev=query_posts('year=$prev_y&monthnum=$prev_m'); ?>
  22. <?php wp_reset_query(); ?>
  23. <?php $m_next=query_posts('year=$next_y&monthnum=$next_m'); ?>
  24. <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement