Skip to content

Instantly share code, notes, and snippets.

@nicksatkovich
Created April 16, 2012 17:03
Show Gist options
  • Select an option

  • Save nicksatkovich/2399979 to your computer and use it in GitHub Desktop.

Select an option

Save nicksatkovich/2399979 to your computer and use it in GitHub Desktop.
<?php
$type = array('post', 'portfolio');
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
//'orderby'=> title,
'orderby' => 'rand',
'order' => 'ASC',
'posts_per_page' => 9, // -1 shows all posts
'caller_get_posts'=> 1
);
$temp = $wp_query; // assign orginal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment