This repository was archived by the owner on Jan 24, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathprojects-list.php
More file actions
131 lines (103 loc) · 3.48 KB
/
Copy pathprojects-list.php
File metadata and controls
131 lines (103 loc) · 3.48 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/**
* Template Name: Projects list
*
* @package Pine
*/
get_header();
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) :
the_post();
$page_title = get_the_title();
$page_content = get_the_content();
?>
<?php if ( has_post_thumbnail() || ! empty( $page_title ) || ! empty( $page_content ) ) : ?>
<div class="<?php if ( has_post_thumbnail() ) : ?>hero-subheader <?php endif; ?>animated fadeIn"<?php pine_thumbnail_src(); ?>>
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-8">
<div class="featured-intro">
<?php the_title( '<h2>', '</h2>' ); ?>
<?php the_content(); ?>
</div><!-- /.featured intro -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="hero-subheader__overlay"></div><!-- /.overlay -->
<?php endif; ?>
</div><!-- /.hero subheader -->
<?php endif; ?>
<?php endwhile; ?>
<div class="projects-list animated bounceInUp">
<div class="projects-list-options">
<div class="container">
<div class="row">
<div class="col-lg-12">
<ul class="projects-cat-toggle clearfix">
<li data-filter="*" class="tabs-nav__item--active"><?php esc_html_e( 'All', 'pine' ); ?></li>
<?php
$pine_terms = get_terms( pine_get_portfolio_taxonomy() );
if ( ! empty( $pine_terms ) && ! is_wp_error( $pine_terms ) ) :
foreach ( $pine_terms as $term ) : ?>
<li data-filter="<?php echo esc_attr( '.cat-' . $term->slug ); ?>"><?php echo esc_html( $term->name ); ?></li>
<?php endforeach;
endif; ?>
</ul><!-- /.projects cat toggle -->
<ul class="projects-type-nav hidden-xs hidden-sm">
<li class="projects-type-nav__item--active project-type-nav__grid"><i class="fa fa-th-large"></i></li>
<li class="project-type-nav__list"><i class="fa fa-list-ul"></i></li>
</ul><!-- /.projects type nav -->
</div><!-- /.col -->
</div><!-- /.row -->
</div>
</div>
<div class="container">
<div class="projects-block__list">
<div class="col-lg-12" id="main">
<?php
$pine_args = array(
// Type Parameters.
'post_type' => pine_get_portfolio_post_type(),
// Pagination Parameters.
'posts_per_page' => pine_get_portfolio_posts_per_page(),
'paged' => $paged,
// Permission Parameters.
'perm' => 'readable',
// Parameters relating to caching.
'no_found_rows' => false,
'cache_results' => true,
);
$wp_query = new WP_Query( $pine_args );
add_filter( 'excerpt_length', 'pine_excerpt_length', 999 );
if ( have_posts() ) :
/* Start the Loop */
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'portfolio-list' );
endwhile;
else :
get_template_part( 'template-parts/content', 'none' );
endif;
remove_filter( 'excerpt_length', 'pine_excerpt_length' );
?>
</div><!-- /.col -->
</div><!-- /.projects block list -->
<?php if ( have_posts() ) : ?>
<div class="row">
<div class="col-lg-12">
<?php pine_posts_pagination(); ?>
</div><!-- /.col -->
</div><!-- /.row -->
<?php endif; ?>
</div><!-- /.container -->
</div><!-- /.projects list -->
<?php wp_reset_postdata(); ?>
<?php get_footer();