This repository was archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-jetpack-portfolio.php
More file actions
63 lines (47 loc) · 1.7 KB
/
single-jetpack-portfolio.php
File metadata and controls
63 lines (47 loc) · 1.7 KB
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
<?php
/**
* The template for displaying all single projects
*
* @package Designer
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="portfolio-main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'portfolio-single' ); ?>
<?php endwhile; // end of the loop. ?>
</div>
<!-- Next/Prev links for portfolio items -->
<div class="portfolio-nav">
<div class="portfolio-links">
<?php previous_post_link( '%link', __( 'Previous Project', 'designer' ) . '' ) ?>
<?php Next_post_link( '%link', __( 'Next Project', 'designer' ) . '' ) ?>
</div>
<a class="button all-projects" href="<?php echo esc_url( get_post_type_archive_link( 'jetpack-portfolio' ) ); ?>">
<?php _e( 'All Projects', 'designer' ); ?>
</a>
</div>
<!-- Get the portfolio items -->
<?php
$posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '10' );
$args = array(
'post_type' => 'jetpack-portfolio',
'posts_per_page' => $posts_per_page,
'post__not_in' => array( get_the_ID() ),
'orderby' => 'rand'
);
$project_query = new WP_Query ( $args );
if ( $project_query -> have_posts() ) :
?>
<div class="portfolio-wrapper <?php echo esc_attr( get_option( 'designer_customizer_portfolio', 'tile' ) ); ?>">
<?php while ( $project_query -> have_posts() ) : $project_query -> the_post();
get_template_part( 'content', 'portfolio-thumbs' );
endwhile;
wp_reset_postdata();
?>
</div><!-- .portfolio-wrapper -->
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>