-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.php
236 lines (198 loc) · 10.9 KB
/
archive.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
/*
Template Name: Archive
*/
?>
<?php get_header(); ?>
<?php
if ( function_exists( 'get_option_tree') ) {
$apex_blogoverviewdate = get_option_tree( 'value_blogoverviewpostdate' );
$apex_blogoverviewpostinfo = get_option_tree('value_blogoverviewpostinfo', '', false, true );
if(!is_array($apex_blogoverviewpostinfo)){ $apex_blogoverviewpostinfo = array(); }
}
$apexlang_in = __('in', 'apex');
$apexlang_by = __('by', 'apex');
$page_ID = idbyslug ('archive');
$pagecustoms = getOptions($page_ID);
if (isset($pagecustoms["header_title"])){$apex_htitle = $pagecustoms['header_title'];}else{$apex_htitle = "";}
if (isset($pagecustoms["sidebar_orientation"])){$apex_sideo = $pagecustoms['sidebar_orientation'];}else{$apex_sideo = 1;}
if ($apex_sideo == 0){$conorient = "right"; $sideoffset = ""; $conoffset = "offset-by-one";}else{$conorient = "left"; $sideoffset = "offset-by-one"; $conoffset = "";}
if (isset($pagecustoms["sidebar"])){$apex_sidebar = $pagecustoms["sidebar"];}else{$apex_sidebar = "Page Sidebar";}
if(isset($wp_query->query_vars['taxonomy']) && taxonomy_exists($wp_query->query_vars['taxonomy'])) {
$value = get_query_var($wp_query->query_vars['taxonomy']);
if (term_exists($wp_query->query_vars['term'])) {
$term = get_term_by( 'slug', get_query_var( 'term' ),$wp_query->query_vars['taxonomy'] );
$apex_htitle = $term->name.'.';
}
}
if (isset($pagecustoms["portfolio_category"])){
$ptype = $pagecustoms['portfolio_category'];
$pcat = "category_".$ptype;
}
if (isset($pagecustoms["portfolio_layout"])){$apex_foliolayout = $pagecustoms['portfolio_layout'];}else{$apex_foliolayout = 0;}
if ($apex_foliolayout == 0){$foliocolumns = "four"; $foliocolumnsnum = 4; $folioteasers = "teasers";}else{$foliocolumns = "eight"; $foliocolumnsnum = 2; $folioteasers = "teasers_large";}
if (isset($pagecustoms["portfolio_alpha"])){ if($pagecustoms['portfolio_alpha']!=""){$apex_folioalpha = $pagecustoms['portfolio_alpha'];}else{$apex_folioalpha = 0;}}else{
$apex_folioalpha = 0;}
?>
<!-- Page Title
================================================== -->
<div class="sixteen columns row divide notop">
<h3 class="titledivider"><?php echo $apex_htitle ?></h3>
<div class="dividerline"></div>
</div>
<?php
if(!isset($wp_query->query_vars['taxonomy']) || !taxonomy_exists($wp_query->query_vars['taxonomy'])) {
?>
<!-- Content Holder -->
<div class="eleven columns <?php echo $conoffset ?> row content <?php echo $conorient ?>">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$blogimageurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
$post_time_day = get_post_time('j', true);
$post_time_monthyear = get_post_time('M Y', true);
$post_time_daymonthyear = date_i18n(get_option('date_format'), strtotime($post->post_date_gmt));
$posttags = get_the_tags();
$postcustoms = getOptions($post->ID);
if (isset($postcustoms["postformat_type"])){$apex_postformat = $postcustoms['postformat_type'];}else{$apex_postformat = 0;}
if (isset($postcustoms["postformat_slider"])){
$slider_imagearr = $postcustoms['postformat_slider'];
$slider_imagelist = explode("\n", str_replace("\r", "", $slider_imagearr));
}else{
$slider_imagelist = 0;
}
if (isset($postcustoms["postformat_video"])){$apex_postvideo = $postcustoms['postformat_video'];}else{$apex_postvideo = "";}
?>
<!-- Blogpost -->
<div class="eleven columns row alpha blogpost <?php get_post_class(); ?>" id="post-<?php the_ID(); ?>">
<div class="eleven columns alpha blogimage">
<?php if($blogimageurl!="" && $apex_postformat!=2 && $apex_postformat!=3 && $apex_postformat!=4){ ?>
<a href="<?php the_permalink(); ?>" data-text="» <?php _e('Read More', 'apex'); ?>" class="hovering"><?php echo '<img src="'.get_template_directory_uri().'/functions/thumb.php?src='.$blogimageurl.'&h=360&w=640&zc=1" alt="" class="scale-with-grid" />'; ?></a>
<?php } else if($apex_postformat==2){ ?>
<div class="flexslider clearfix">
<ul class="slides">
<?php foreach($slider_imagelist as $slider_image):
echo '<li><img src="'.$slider_image.'" alt="" /></li>';
endforeach; ?>
</ul>
</div>
<?php } else if($apex_postformat==3){ ?>
<div class="scalevid">
<iframe src="http://www.youtube.com/embed/<?php echo $apex_postvideo ?>?hd=1&wmode=opaque&controls=1&showinfo=0" width="640" height="360"></iframe>
</div>
<?php } else if($apex_postformat==4){ ?>
<div class="scalevid">
<iframe src="http://player.vimeo.com/video/<?php echo $apex_postvideo ?>?title=0&byline=0&portrait=0" width="640" height="360"></iframe>
</div>
<?php } ?>
</div>
<?php if($apex_blogoverviewdate == "Date Box"){ ?>
<div class="one column row alpha">
<div class="blogdate"><div class="day"><?php echo $post_time_day ?></div><span><?php echo $post_time_monthyear ?></span></div>
</div>
<div class="nine columns row offset-by-one omega">
<?php } else { ?>
<div class="eleven columns row alpha">
<?php } ?>
<div class="blogtitle"><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4></div>
<div class="postinfo">
<?php if (in_array("Date",$apex_blogoverviewpostinfo)){ echo $post_time_daymonthyear ?> <span class="divide">|</span> <?php } ?>
<?php if (in_array("Categories",$apex_blogoverviewpostinfo)){ echo $apexlang_in ?> <?php the_category(' ',' '); ?> <span class="divide">|</span> <?php } ?>
<?php if (in_array("Author",$apex_blogoverviewpostinfo)){ echo $apexlang_by ?> <?php the_author(); ?> <span class="divide">|</span> <?php } ?>
<?php if (in_array("Comments",$apex_blogoverviewpostinfo)){ if ( comments_open() ) : ?><?php comments_popup_link(__('No Comments', 'apex'), __('One Comment', 'apex'), __( '% Comments', 'apex')); ?> <span class="divide">|</span> <?php endif; } ?>
</div>
<div class="postcontent"><?php echo excerpt(35); ?><br/><br/><a href="<?php the_permalink(); ?>" class="link">» <?php _e('Read More', 'apex'); ?></a></div>
</div>
<div class="clear"></div>
</div>
<?php endwhile; ?>
<!-- Pagination -->
<?php if(function_exists('pagination')){ pagination(); }else{ paginate_links(); } ?>
<!-- Pagination End -->
<?php else : ?>
<div class="eleven columns row alpha">
<p><?php _e('Oops, we could not find what you were looking for...', 'apex'); ?></p>
</div>
<?php endif; ?>
</div>
<!-- Sidebar
================================================== -->
<div class="four columns sidebar <?php echo $sideoffset ?> content">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($apex_sidebar) ) : ?>
<div class="widget">
<h5>Sidebar Widget Area</h5>
<div>
Please configure this Widget Area in the Admin Panel under Appearance -> Widgets
</div>
<div class="clear"></div>
</div>
<?php endif; ?>
<div class="clear"></div>
</div>
<?php
} //end normal archive
else{
//start portfolio archive
$args=array(
'post_type' => $ptype,
'posts_per_page' => 199
);
$temp = $wp_query;
?>
<!-- Portfolio
================================================== -->
<div class="sixteen columns row <?php echo $folioteasers ?> portfolio">
<?php if ($wp_query->have_posts()) : ?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php
$custom = get_post_custom($post->ID);
$foliocatlist = get_the_term_list( $post->ID, $pcat, '', ', ', '' );
$entrycategory = get_the_term_list( $post->ID, $pcat, '', '_', '' );
$entrycategory = strip_tags($entrycategory);
$entrycategory = strtolower($entrycategory);
$entrycategory = str_replace(' ', '-', $entrycategory);
$entrycategory = str_replace('_', ' ', $entrycategory);
$entrytitle = get_the_title();
$blogimageurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
?>
<div class="<?php echo $foliocolumns ?> columns teaser all-group <?php echo $entrycategory ?>">
<a href="<?php the_permalink(); ?>" data-text="» <?php _e('Visit Project', 'apex'); ?>" class="hovering"><?php echo '<img src="'.get_template_directory_uri().'/functions/thumb.php?src='.$blogimageurl.'&h=272&w=460&zc=1" alt="" class="scale-with-grid" />'; ?></a>
<div class="pluswrap">
<a href="<?php the_permalink(); ?>" class="bigplus"></a>
<div class="topline"><a href="<?php the_permalink(); ?>"><?php echo $entrytitle ?></a></div>
<div class="subline"><?php echo $foliocatlist ?></div>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class="eleven columns row alpha">
<p><?php _e('Oops, we could not find what you were looking for...', 'apex'); ?></p>
</div>
<?php endif; ?>
<?php
$wp_query = null;
$wp_query = $temp;
wp_reset_query();
?>
<div class="clear"></div>
</div><div class="clear"></div>
<!-- Space Adjuster
================================================== -->
<div class="sixteen columns bottomadjust"></div><div class="clear"></div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.portfolio<?php echo $foliocolumnsnum ?>column').tpportfolio({
speed:500,
row:<?php echo $foliocolumnsnum ?>,
nonSelectedAlpha:<?php echo $apex_folioalpha ?>,
portfolioContainer:'.portfolio'
});
});
</script>
<?php
}
?>
<!-- Space Adjuster
==================================================
<div class="sixteen columns bottomadjust"></div> -->
<?php get_footer(); ?>