Want more features on Pastebin? Sign Up, it's FREE!
Guest

Custom Loop/Query Based on Custom Fields

By: a guest on Apr 16th, 2010  |  syntax: PHP  |  size: 0.39 KB  |  views: 1,497  |  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.             $args=array(
  3.                 'meta_key'=>'readmoretext',
  4.                 'meta_value'=>'Go check this out',
  5.                 'post_status'=>'publish',
  6.                 'post_type'=>'post',
  7.                 'orderby'=>'date',
  8.                 'order'=>'DESC'
  9.             );
  10.             $wp_query= null;
  11.             $wp_query = new WP_Query();
  12.  
  13.             $wp_query->query($args);
  14. ?>
clone this paste RAW Paste Data