-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathloop-portfolio.php
88 lines (71 loc) · 3.03 KB
/
loop-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
<?php if ( $_GET['title'] != 'false' ): ?>
<h1><?php echo isset( $_GET['title'] ) ? $_GET['title'] : $post->post_title; ?></h1>
<?php endif; ?>
<ul id="portfolio-filter">
<li><a href="#all" title="">All</a></li>
<?php
$terms = get_terms( "portfolio_entries" );
if ( count( $terms ) > 0 ) {
foreach ( $terms as $term ) {
?>
<li><a href="#<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li>
<?php
}
}
?>
</ul>
<ul id="portfolio-list">
<?php
switch( $_GET['columns'] ) {
case 1:
$columns = 1; $height = 350; $width = 900; $ppp = 50;
if ( get_option( 'adelante_css_framework' ) === '1140' ) { $width = 1000; }
break;
case 2:
$columns = 2; $height = 230; $width = 410; $ppp = 50;
if ( get_option( 'adelante_css_framework' ) === '1140' ) { $width = 480; $height = 250; }
break;
case 4:
$columns = 4; $height = 125; $width = 194; $ppp = 50;
if ( get_option( 'adelante_css_framework' ) === '1140' ) { $width = 228; $height = 140; }
break;
default:
$columns = 3; $height = 150; $width = 265; $ppp = 50;
if ( get_option( 'adelante_css_framework' ) === '1140' ) { $width = 310; $height = 200; }
}
$counter = 0;
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
query_posts( "paged=$paged&post_type=portfolio&posts_per_page=$ppp" );
if ( have_posts() ) : while( have_posts() ) : the_post();
$postTerms = array();
$terms = wp_get_post_terms( $post->ID, "portfolio_entries" );
foreach($terms as $term){
$postTerms[] = $term->slug;
}
?>
<li style="width: <?php echo $width; ?>px;" id="post-<?php the_ID(); ?>" data-id="post-<?php the_ID(); ?>" <?php echo post_class( array( implode(" ", $postTerms)) ); ?>>
<?php adelante_featured_image( $height, $width ); ?>
<h3 class="blog_header"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
</li>
<?php $counter++; ?>
<?php endwhile; ?>
</ul>
<?php else : ?>
<div class="notice">
<p class="bottom">Sorry, no results were found.</p>
</div>
<?php get_search_form(); ?>
<?php
endif;
wp_reset_postdata();
?>
<div class="clearboth"></div>
<?php if ( function_exists( 'wp_pagenavi' ) ) wp_pagenavi(); ?>
<script>
$(function(){
$('#portfolio-list').filterable();
});
</script>