Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 2.18 KB  |  views: 108  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3.      if( get_query_var('paged') < 2 ) { ?>
  4. <?php $already_posted = array(); ?>
  5.  
  6. <?php
  7. query_posts('category_name=CatName1&showposts=1');
  8. if (have_posts()) : while (have_posts()) :
  9. the_post();
  10. setup_postdata($post); ?>
  11.  
  12. // loop 1
  13.  
  14. <?php $already_posted[]= $post->ID; endwhile; ?>
  15.  
  16.  
  17.     <?php else : ?>
  18.  
  19.     <b>Not Found</b>
  20.  
  21. <?php endif; ?>
  22.  
  23.  
  24. <?php $args = array( 'category_name'=>'CatName2,CatName3', 'numberposts' => 1, 'post__not_in' => $already_posted );
  25. $rand_posts = get_posts( $args );
  26. foreach( $rand_posts as $post ) :
  27. setup_postdata($post); ?>
  28.  
  29. // loop 2
  30.  
  31. <?php $already_posted[]= $post->ID; endforeach; ?>
  32.  
  33. <?php $args = array( 'category_name'=>'CatName2,CatName3', 'numberposts' => 5, 'post__not_in' => $already_posted );
  34. $rand_posts = get_posts( $args );
  35. foreach( $rand_posts as $post ) :
  36. setup_postdata($post); ?>
  37.  
  38. // loop 3
  39.  
  40. <?php $already_posted[]= $post->ID; endforeach; ?>
  41.  
  42.  
  43. <?php $args = array( 'category_name'=>'CatName4', 'numberposts' => 1, 'post__not_in' => $already_posted );
  44. $rand_posts = get_posts( $args );
  45. foreach( $rand_posts as $post ) :
  46. setup_postdata($post); ?>
  47.  
  48. // loop 4
  49.  
  50. <?php $already_posted[]= $post->ID; endforeach; ?>
  51.  
  52.  
  53. <?php $args = array( 'category_name'=>'CatName4', 'numberposts' => 5, 'post__not_in' => $already_posted );
  54. $rand_posts = get_posts( $args );
  55. foreach( $rand_posts as $post ) :
  56. setup_postdata($post); ?>
  57.  
  58. // loop 5
  59.  
  60. <?php $already_posted[]= $post->ID; endforeach; ?>
  61. Learn more about <b><a href="/buffyrewatch">Buffy Rewatch</a></b>
  62. </div></div>
  63.  
  64. <?php $args = array( 'category_name'=>'CatName5', 'numberposts' => 1, 'post__not_in' => $already_posted );
  65. $rand_posts = get_posts( $args );
  66. foreach( $rand_posts as $post ) :
  67. setup_postdata($post); ?>
  68.  
  69. // loop 6
  70.  
  71. <?php $already_posted[]= $post->ID; endforeach; ?>
  72.  
  73.  
  74. <?php } ?>
  75.  
  76. <?php
  77. $temp = $wp_query;
  78. $wp_query= null;
  79. $wp_query = new WP_Query();
  80. $wp_query->query('showposts=10'.'&paged='.$paged);
  81. ?>
  82. <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  83.  
  84.  
  85. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  86.  
  87. // loop 7, paginated
  88. <?php endwhile; ?>
  89.  
  90. // pagination code
  91.  
  92. <?php $wp_query = null; $wp_query = $temp;?>