Skip to content

Instantly share code, notes, and snippets.

@curtismchale
Created July 12, 2014 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curtismchale/34ddb84e04db01aeb68d to your computer and use it in GitHub Desktop.
Save curtismchale/34ddb84e04db01aeb68d to your computer and use it in GitHub Desktop.
<?php
/**
* Abstracting the featured Ads Query so that we don't have to retype it all over
*
* @class WP_Query
* @uses wp_parse_args
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*/
class Paths_Portfolio_Query extends WP_Query{
function __construct( $args = array() ){
$args = wp_parse_args( $args, array(
'post_type' => 'portfolio',
'posts_per_page' => '4',
'orderby' => 'rand',
) );
parent::__construct( $args );
} // __construct
} // Paths_Portfolio_Query
$new_query = new Paths_Portfolio_Query( array( 'posts_per_page' => '10' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment