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

Specific-post-loop.php

By: LittleBrother on Feb 25th, 2014  |  syntax: None  |  size: 0.32 KB  |  views: 31  |  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.         if( is_category() ) :
  3.         $the_query = new WP_Query('tag=featured&showposts=2&cat='.get_query_var('cat'));
  4.         else : $the_query = new WP_Query('showposts=2&orderby=post_date&order=desc');
  5.         endif;
  6. ?>
  7.                                
  8. <?php
  9.         if( $the_query->have_posts() ) : while( $the_query->have_posts() ) : $the_query->the_post()
  10. ?>