-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxonomy-portfolio-type.php
125 lines (115 loc) · 4.65 KB
/
taxonomy-portfolio-type.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
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
<?php get_header();
get_template_part('templates/page', 'header');
global $pinnacle;
if(isset($pinnacle['portfolio_style_default'])) {
$pstyleclass = $pinnacle['portfolio_style_default'];
} else {
$pstyleclass = 'padded_style';
}
if(isset($pinnacle['portfolio_ratio_default'])) {
$pimgratio = $pinnacle['portfolio_ratio_default'];
} else {
$pimgratio = "square";
}
if(isset($pinnacle['portfolio_hover_style_default'])) {
$phoverstyleclass = $pinnacle['portfolio_hover_style_default'];
} else {
$phoverstyleclass = 'p_lightstyle';
}
if(!empty($pinnacle['portfolio_tax_column'])) {
$portfolio_column = $pinnacle['portfolio_tax_column'];
} else {
$portfolio_column = 4;
}
if ($portfolio_column == '2') {
$itemsize = 'tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12';
$slidewidth = 600;
} else if ($portfolio_column == '3'){
$itemsize = 'tcol-md-4 tcol-sm-4 tcol-xs-6 tcol-ss-12';
$slidewidth = 400;
} else if ($portfolio_column == '6'){
$itemsize = 'tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-6';
$slidewidth = 300;
} else if ($portfolio_column == '5'){
$itemsize = 'tcol-md-25 tcol-sm-3 tcol-xs-4 tcol-ss-6';
$slidewidth = 300;
} else {
$itemsize = 'tcol-md-3 tcol-sm-4 tcol-xs-6 tcol-ss-12';
$slidewidth = 300;
}
if($pimgratio == 'portrait') {
$temppimgheight = $slidewidth * 1.35;
$slideheight = floor($temppimgheight);
} else if($pimgratio == 'landscape') {
$temppimgheight = $slidewidth / 1.35;
$slideheight = floor($temppimgheight);
} else if($pimgratio == 'widelandscape') {
$temppimgheight = $slidewidth / 2;
$slideheight = floor($temppimgheight);
} else {
$slideheight = $slidewidth;
}
$showexcerpt = 'false';
$portfolio_lightbox = 'false';
$portfolio_item_types = 'true';
// Set global loop var
global $kt_portfolio_loop;
$kt_portfolio_loop = array(
'lightbox' => $portfolio_lightbox,
'showexcerpt' => $portfolio_excerpt,
'showtypes' => $portfolio_item_types,
'pstyleclass' => $pstyleclass,
'slidewidth' => $slidewidth,
'slideheight' => $slideheight,
);
?>
<div id="content" class="container">
<div class="row">
<div class="main <?php echo esc_attr( pinnacle_main_class() ); ?>" role="main">
<?php echo category_description(); ?>
<?php if (!have_posts()) : ?>
<div class="alert">
<?php _e('Sorry, no results were found.', 'ona-white-angus'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<div id="portfoliowrapper" class="rowtight <?php echo esc_attr($pstyleclass);?> <?php echo esc_attr($phoverstyleclass);?>">
<?php global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$termslug = $cat_obj->slug;
query_posts(array(
'paged' => $paged,
'posts_per_page' => '12',
'orderby' => 'menu_order',
'order' => 'ASC',
'post_type' => 'portfolio',
'portfolio-type' => $termslug
)
);
while (have_posts()) : the_post(); ?>
<div class="<?php echo esc_attr($itemsize);?> p-item">
<?php do_action('kadence_portfolio_loop_start');
get_template_part('templates/content', 'loop-portfolio');
do_action('kadence_portfolio_loop_end');
?>
</div>
<?php endwhile; ?>
</div> <!--portfoliowrapper-->
<?php if ($wp_query->max_num_pages > 1) :
if(function_exists('pinnacle_wp_pagination')) {
pinnacle_wp_pagination();
} else { ?>
<nav id="post-nav" class="pager">
<div class="previous"><?php next_posts_link(__('← Older posts', 'ona-white-angus')); ?></div>
<div class="next"><?php previous_posts_link(__('Newer posts →', 'ona-white-angus')); ?></div>
</nav>
<?php }
endif;
$wp_query = null;
wp_reset_query(); ?>
</div><!-- /.main -->
<?php get_sidebar(); ?>
</div><!-- /.row-->
</div><!-- /.content -->
</div><!-- /.wrap -->
<?php get_footer(); ?>