Created
March 3, 2016 14:02
-
-
Save richtabor/0830d854a23fc6fca92e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The file for displaying the more portfolio loop below the portfolio single. | |
* It is called via the single-portfolio.php. | |
* | |
* | |
* @package WordPress | |
* @subpackage Trim | |
* @author ThemeBeans | |
* @since Trim 1.0 | |
*/ | |
//POST TYPE CONDITIONS | |
if ( is_singular('portfolio') ) { | |
$loop = 'loop-portfolio'; | |
$post_type = 'portfolio'; | |
} elseif ( is_singular('download') ) { | |
$loop = 'loop-download'; | |
$post_type = 'download'; | |
} else { | |
$loop = 'loop-post'; | |
$post_type = 'post'; | |
} | |
$args = array( | |
'post_type'=> $post_type, | |
'order'=> 'DSC', | |
'orderby'=> 'rand', | |
'posts_per_page' => '14', | |
'post__not_in' => array($post->ID) | |
); | |
query_posts($args); if (have_posts()) : while (have_posts()) : the_post(); | |
get_template_part( $loop ); | |
endwhile; endif; wp_reset_query(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment