forked from themebeans/trim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-download.php
46 lines (36 loc) · 951 Bytes
/
content-download.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Portfolio filtering code.
*
* @package Trim
* @link https://themebeans.com/themes/trim
*/
// PULL PAGINATION FROM CUSTOMIZATION
$portfolio_posts_count = get_theme_mod( 'portfolio_posts_count', trim_defaults( 'portfolio_posts_count' ) );
if ( is_tax() ) {
global $query_string;
query_posts( "{$query_string}&posts_per_page=-1" );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'loop-download' );
endwhile;
endif;
wp_reset_postdata();
} else {
// LOAD PORTFOLIO QUERY
$args = array(
'post_type' => 'download',
'order' => 'DSC',
'orderby' => 'menu_order',
'posts_per_page' => $portfolio_posts_count,
);
$wp_query = new WP_Query( $args );
if ( $wp_query->have_posts() ) :
while ( $wp_query->have_posts() ) :
$wp_query->the_post();
get_template_part( 'loop-download' );
endwhile;
endif;
wp_reset_postdata();
} //END else is_tax()