-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_portfolio_2c.php
83 lines (64 loc) · 3.13 KB
/
page_portfolio_2c.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
<?php
/*
Template Name: Portfolio 2 Columns
*/
?>
<?php get_header(); ?>
<div id="main">
<?php
$terms = get_terms("tagportfolio");
$count = count($terms);
echo '<ul id="portfolio-filter">';
echo '<li><a href="#all" title="">All</a></li>';
if ( $count > 0 )
{
foreach ( $terms as $term ) {
$termname = strtolower($term->name);
$termname = str_replace(' ', '-', $termname);
echo '<li><a href="#'.$termname.'" title="" rel="'.$termname.'">'.$term->name.'</a></li>';
}
}
echo "</ul>";
?>
<?php
$loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1));
$count =0;
?>
<div id="portfolio-wrapper">
<ul id="portfolio-list">
<?php if ( $loop ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'tagportfolio' );
if ( $terms && ! is_wp_error( $terms ) ) :
$links = array();
foreach ( $terms as $term )
{
$links[] = $term->name;
}
$links = str_replace(' ', '-', $links);
$tax = join( " ", $links );
else :
$tax = '';
endif;
?>
<?php $infos = get_post_custom_values('_url'); ?>
<li class="portfolio-item <?php echo strtolower($tax); ?> all">
<div class="thumb"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( array(270, 225) ); ?></a></div>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<p class="links"><a href="<?php the_permalink() ?>">More Details</a></p>
</li>
<?php endwhile; else: ?>
<li class="error-not-found">Sorry, no portfolio entries found.</li>
<?php endif; ?>
</ul>
<div class="clearboth">
</div>
<script>
jQuery(document).ready(function() {
jQuery("#portfolio-list").filterable();
});
</script>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>