Advertisement
Guest User

Untitled

a guest
May 22nd, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  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); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement