-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-portfolio.php
67 lines (59 loc) · 1.61 KB
/
page-portfolio.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* The template for displaying all the portfolio
*
* @package Dsignfly
*/
get_header();
get_template_part( 'template-parts/features' );
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => 15,
'paged' => get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1,
);
$the_query = new WP_Query( $args );
?>
<main id="primary" class="portfolio-main">
<div class="page-title">
<h1>DESIGN IS THE SOUL</h1>
<div class="portfolio-filter">
<span>Advertising</span>
<span>Multimedia</span>
<span>Photography</span>
</div>
</div>
<hr>
<div class="portfolio-content">
<?php
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) :
$the_query->the_post();
get_template_part( 'template-parts/portfolio', 'card' );
endwhile;
endif;
?>
</div>
<div class="portfolio-pagination">
<?php
$total_pages = $the_query->max_num_pages;
if ( $total_pages > 1 ) {
$current_page = max( 1, get_query_var( 'paged' ) );
echo paginate_links(
array(
'base' => get_pagenum_link( 1 ) . '%_%',
'format' => '/page/%#%',
'current' => $current_page,
'total' => $total_pages,
'next_text' => '<img src="' . get_template_directory_uri() . '/images/pagination-arrow.png" alt="arrow-right" />',
'prev_text' => '<img
style="transform: rotate(180deg);"
src="' . get_template_directory_uri() . '/images/pagination-arrow.png" alt="arrow-left" />',
)
);
}
?>
</div>
</main><!-- #main -->
<?php
wp_reset_postdata();
get_footer();