-
Notifications
You must be signed in to change notification settings - Fork 2
/
single-jetpack-portfolio.php
94 lines (69 loc) · 3.32 KB
/
single-jetpack-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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* The template for displaying single projects.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Noah Lite
* @since Noah Lite 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
get_header(); ?>
<div id="primary" data-section-name="<?php echo esc_attr( get_post_field( 'post_name', get_post() ) ); ?>" class="content-area u-container-sides-spacings u-content_container_padding_top u-content-bottom-spacing">
<div class="o-wrapper u-container-width">
<main id="main" class="o-wrapper u-content-width site-main" role="main">
<?php while ( have_posts() ) : the_post();
get_template_part( 'template-parts/project/content-single', 'jetpack-portfolio' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) { ?>
<div class="js-header-height-padding-top">
<?php comments_template(); ?>
</div>
<?php }
endwhile; // End of the loop. ?>
</main><!-- #main -->
</div>
</div><!-- #primary -->
<div id="projectsArchive" data-section-name="archive" class="c-project__more js-project-more-content">
<div class="content-area">
<?php if ( ! empty( $comments ) ) { ?>
<div class="c-separator"></div>
<div class="u-content-width u-content-bottom-spacing js-header-height-padding-top">
<?php echo $comments; ?>
</div>
<?php } ?>
<div class="u-align-center js-share-target c-page-header__side"></div>
<div class="c-separator"></div>
<header class="u-align-center">
<?php the_archive_title( '<h1 class="c-project__more-title h4">', '</h1>' ); ?>
</header><!-- .page-header -->
<div class="u-content-bottom-spacing">
<?php
$projects = new WP_Query( array(
'post_type' => 'jetpack-portfolio',
'posts_per_page' => -1, //we want all the projects here
) );
if ( $projects->have_posts() ) : ?>
<div class="u-content-background">
<section class="c-archive-loop u-full-width u-portfolio_sides_spacing u-content-bottom-spacing">
<div class="o-wrapper u-portfolio_grid_width">
<div <?php noahlite_portfolio_class(); ?>>
<?php while ( $projects->have_posts() ) : $projects->the_post();
get_template_part( 'template-parts/project/content', 'jetpack-portfolio' );
endwhile; ?>
</div>
</div><!-- .o-wrapper -->
</section><!-- .c-archive-loop -->
</div><!-- .u-content-background -->
<?php else : ?>
<div class="u-content-width">
<?php get_template_part( 'template-parts/content', 'none' ); ?>
</div>
<?php endif;
wp_reset_postdata(); ?>
</div><!-- .u-content-bottom-spacing -->
</div><!-- .content-area -->
</div><!-- #projectsArchive -->
<?php get_footer();