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 May 22nd, 2011  |  syntax: PHP  |  size: 0.81 KB  |  views: 51  |  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.     // grab top voted posts in order (this is grabbing the page name too :?)
  3.    
  4.     $query_sql = "SELECT like_pid FROM " . $wpdb->prefix ."likes_count ORDER BY like_count DESC";
  5.     $query_result = $wpdb->get_col( $wpdb->prepare ($query_sql, OBJECT));
  6.     if ($query_result) {
  7.     foreach ($query_result as $post_id) {
  8.     $post = &get_post( $post_id );
  9.     setup_postdata($post);
  10.     ?>
  11.    
  12.     // Now count out two articles (more fail code?)
  13.    
  14.     <?php $count++; ?>
  15.     <?php if ($count%2== 0) : ?>
  16.    
  17.     // Show the two articles
  18.    
  19.     <?php else : ?>
  20.    
  21.     //Now do something else
  22.    
  23.     <?php endif;?>
  24.     <?php } ?>
  25.     <?php } ?>
  26.    
  27.     <div class="next"> <?php next_posts_link('&raquo;' ,0); ?></div>
  28.     <div class="previous"> <?php previous_posts_link('&laquo;' ,0); ?>
clone this paste RAW Paste Data