File: D:/HostingSpaces/PDeckers/zuinighuis.be/wwwroot/wp-content/themes/Avada/portfolio-two-column.php
<?php
// Template Name: Portfolio Two Column
get_header(); ?>
<?php
$content_css = 'width:100%';
$sidebar_css = 'display:none';
if(get_post_meta($post->ID, 'pyre_portfolio_full_width', true) == 'yes') {
$content_css = 'width:100%';
$sidebar_css = 'display:none';
}
elseif(get_post_meta($post->ID, 'pyre_portfolio_sidebar_position', true) == 'left') {
$content_css = 'float:right;';
$sidebar_css = 'float:left;';
$content_class = 'portfolio-two-sidebar';
} elseif(get_post_meta($post->ID, 'pyre_portfolio_sidebar_position', true) == 'right') {
$content_css = 'float:left;';
$sidebar_css = 'float:right;';
$content_class = 'portfolio-two-sidebar';
}
?>
<div id="content" class="portfolio portfolio-two <?php echo $content_class; ?>" style="<?php echo $content_css; ?>">
<?php while(have_posts()): the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post-content">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
</div>
</div>
<?php $current_page_id = $post->ID; ?>
<?php endwhile; ?>
<?php
$portfolio_category = get_terms('portfolio_category');
if($portfolio_category):
?>
<ul class="portfolio-tabs clearfix">
<li class="active"><a data-filter="*" href="#"><?php echo __('All', 'Avada'); ?></a></li>
<?php foreach($portfolio_category as $portfolio_cat): ?>
<?php if(get_post_meta(get_the_ID(), 'pyre_portfolio_category', true) && !in_array('0', get_post_meta(get_the_ID(), 'pyre_portfolio_category', true))): ?>
<?php if(in_array($portfolio_cat->term_id, get_post_meta(get_the_ID(), 'pyre_portfolio_category', true))): ?>
<li><a data-filter=".<?php echo $portfolio_cat->slug; ?>" href="#"><?php echo $portfolio_cat->name; ?></a></li>
<?php endif; ?>
<?php else: ?>
<li><a data-filter=".<?php echo $portfolio_cat->slug; ?>" href="#"><?php echo $portfolio_cat->name; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="portfolio-wrapper">
<?php
if(is_front_page()) {
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
} else {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
}
$args = array(
'post_type' => 'avada_portfolio',
'paged' => $paged,
'posts_per_page' => $data['portfolio_items'],
);
$pcats = get_post_meta(get_the_ID(), 'pyre_portfolio_category', true);
if($pcats && $pcats[0] == 0) {
unset($pcats[0]);
}
if($pcats){
$args['tax_query'][] = array(
'taxonomy' => 'portfolio_category',
'field' => 'ID',
'terms' => $pcats
);
}
$gallery = new WP_Query($args);
while($gallery->have_posts()): $gallery->the_post();
if($pcats) {
$permalink = tf_addUrlParameter(get_permalink(), 'portfolioID', $current_page_id);
} else {
$permalink = get_permalink();
}
if(has_post_thumbnail() || get_post_meta($post->ID, 'pyre_video', true)):
?>
<?php
$item_classes = '';
$item_cats = get_the_terms($post->ID, 'portfolio_category');
if($item_cats):
foreach($item_cats as $item_cat) {
$item_classes .= $item_cat->slug . ' ';
}
endif;
?>
<div class="portfolio-item <?php echo $item_classes; ?>">
<?php if(has_post_thumbnail()): ?>
<div class="image">
<a href="<?php echo $permalink; ?>">
<?php the_post_thumbnail('portfolio-two'); ?>
</a>
<div class="image-extras">
<div class="image-extras-content">
<a class="icon link-icon" href="<?php echo $permalink; ?>">Permalink</a>
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
<?php
if(get_post_meta($post->ID, 'pyre_video_url', true)) {
$full_image[0] = get_post_meta($post->ID, 'pyre_video_url', true);
}
?>
<a class="icon gallery-icon" href="<?php echo $full_image[0]; ?>" rel="prettyPhoto[gallery]" title="<?php echo get_post_field('post_content', get_post_thumbnail_id($post->ID)); ?>"><img style="display:none;" alt="<?php echo get_post_field('post_excerpt', get_post_thumbnail_id($post->ID)); ?>" />Gallery</a>
<h3><?php the_title(); ?></h3>
<h4><?php echo get_the_term_list($post->ID, 'portfolio_category', '', ', ', ''); ?></h4>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; endwhile; ?>
</div>
<?php themefusion_pagination($gallery->max_num_pages, $range = 2); ?>
</div>
<div id="sidebar" style="<?php echo $sidebar_css; ?>"><?php generated_dynamic_sidebar(); ?></div>
<?php get_footer(); ?>