-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathportfolio-three-column.php
More file actions
93 lines (89 loc) · 4.31 KB
/
portfolio-three-column.php
File metadata and controls
93 lines (89 loc) · 4.31 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
<?php
// Template Name: Portfolio Three Column
// Exit if accessed directly
if (!defined('ABSPATH')) {echo '<h1>Forbidden</h1>'; exit();} get_header(); ?>
<?php global $fi_print_options;
$number=esc_attr($fi_print_options['portfolio_number']);
query_posts('post_type=portfolio&posts_per_page='.$number.'&post_status=publish&paged='. get_query_var('paged'));
$w='263';
$h='252';
?>
<section class="on-homepage portfolio">
<div class="container">
<?php
$arguments = array(
'type' => 'portfolio',
'taxonomy' => 'portfolio_filter',
'pad_counts' => false
);
$categories = get_categories( $arguments );?>
<div id="projects-filter" class="text-left">
<a href="#" data-filter="*" class="active"><?php _e( 'All', 'fi_print' ); ?></a>
<?php foreach($categories as $i=>$category) { ?>
<a data-filter=".<?php echo $category->slug; ?>" href="#"><em><?php echo '0'.++$i.'.';?></em><?php echo $category->name; ?></a>
<?php } ?>
</div>
<?php if (have_posts()) : ?>
<div class="row">
<div class="col-md-12">
<div class="row" id="portfolio-grid">
<?php while (have_posts()) : the_post(); ?>
<?php
$portfolio_item_title = get_the_title( $post->ID );
$image_url= wp_get_attachment_thumb_url( get_post_thumbnail_id($post->ID) );
$thumb = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
$terms = get_the_terms( $post->ID, 'portfolio_filter' );
if ( $terms && ! is_wp_error( $terms ) ) :
$term_links = array();
foreach ( $terms as $term ) {
$term_links[] = $term->slug;
}
$filters = join( " ", $term_links );
endif;
?>
<div class="item col-md-4 col-sm-6 col-xs-12 <?php echo esc_attr($filters); ?>">
<div class="thumb-holder">
<?php $thumbnail = get_post_thumbnail_id($post->ID);
$img_url = wp_get_attachment_image_src( $thumbnail,'full'); //get img URL
$n_img = aq_resize( $img_url[0], $width = $w, $height = $h, $crop = true, $single = true, $upscale = true );
?><img src="<?php echo esc_url($n_img);?>" alt="">
<div class="thumb-content">
<div class="thumb-likes">
<!-- <span><i class="fa fa-heart-o"></i>29</span> -->
</div>
<div class="thumb-text">
<a href="<?php echo the_permalink();?>"><h4><?php fi_print_post_title(); ?></h4></a>
<span><i class="fa fa-folder-o"></i>
<?php
$filters = get_the_terms($post->ID,'portfolio_filter');
$c_filter = '';
if(!empty($filters)){
foreach($filters as $f=>$filter){
$c_filter .= ($f==0) ? $filter->name : ', '.$filter->name;
}
echo esc_html($c_filter);
}
?></span>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
<div class="col-md-12 text-center">
<div class="work-button">
<?php if ($wp_query->max_num_pages>1) : ?>
<div class="blog-pagination">
<?php fi_print_pagination(); ?>
</div>
<?php endif; ?>
</div>
</div>
<?php else : ?>
<?php get_template_part('partials/nothing-found'); ?>
<?php endif; wp_reset_query();?>
</div>
</section>
<?php get_footer(); ?>