-
Notifications
You must be signed in to change notification settings - Fork 0
/
portfolio.php
63 lines (51 loc) · 1.64 KB
/
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
<?php
/**
* Template Name: Portfolio
*
* @package Eighties
* @author Justin Kopepasah
* @since 1.0.0
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php
/**
* Since this is the portfolio template, we should
* display some projects. We use get posts here,
* because we are only retreving a set amount of
* projects.
*/
$args = array(
'post_type' => 'jetpack-portfolio',
'posts_per_page' => 12,
);
$portfolio = get_posts( $args );
?>
<div id="portfolio-wrapper">
<?php foreach ( $portfolio as $post ) : setup_postdata( $post ); ?>
<?php get_template_part( 'content', 'portfolio' ); ?>
<?php endforeach; ?>
</div>
<?php
wp_reset_postdata();
?>
<nav class="navigation paging-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Porfolio page.', 'eighties' ); ?></h1>
<div class="nav-links">
<a href="<?php echo get_post_type_archive_link( 'jetpack-portfolio' ); ?>" class="btn"><?php _e( 'View Portfolio', 'eighties' ); ?></a>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>