ACC SHELL
<?php
/*
Template Name: Portfolio
*/
get_header();
// Parallax Title
$parallax_title = get_post_meta( $post->ID, 'coffee_parallax_title', true);
// Parallax Background
$parallax_background = get_option('parallax_background', get_template_directory_uri().'/img/parallax-bg.jpg');
$parallax_background_meta = get_post_meta( $post->ID, 'coffee_parallax_background', true);
if($parallax_background_meta != ''){$parallax_background = $parallax_background_meta;}
// Parallax Height
$parallax_height = get_option('parallax_height', '125');
$parallax_height_meta = get_post_meta( $post->ID, 'coffee_parallax_height', true);
if($parallax_height_meta != ''){$parallax_height = $parallax_height_meta;}
// Parallax Speed
$parallax_speed = get_option('parallax_speed', '12');
$parallax_speed_meta = get_post_meta( $post->ID, 'coffee_parallax_speed', true);
if($parallax_speed_meta != ''){$parallax_speed = $parallax_speed_meta;}
$have_content = 'no-content';
?>
<?php if ($parallax_height != 0) { ?>
<div id="parallax-wrapper" style="background-image: url('<?php echo($parallax_background); ?>'); height: <?php echo($parallax_height); ?>px;" data-parallax-speed="<?php echo($parallax_speed); ?>" <?php if(get_option('header_switch', true)){echo('class="parallax-on"');} ?>>
<div id="parallax-inner" class="clearfix">
<div id="parallax-title-wrapper">
<div id="parallax-title" class="heading-font">
<?php echo($parallax_title); ?>
</div>
</div>
<div id="parallax-aside-wrapper" class="parallax-filters">
<div id="parallax-filter" class="heading-font">
<ul class="filters">
<li class="filter all active current"><a href="javascript:;" data-filter="*"><?php _e('All', 'coffee'); ?></a></li>
<?php
$args = array( 'orderby' => 'name', 'order' => 'ASC', 'taxonomy' => 'portfolio_category', 'hierarchical' => 1 );
$categories = get_categories($args);
foreach ($categories as $category) {
$output = '<li class="filter active"><a class="'. $category->category_nicename .'" href="javascript:;" data-filter="'.$category->category_nicename.'">';
$output .= $category->cat_name;
$output .= '</a></li>';
echo $output;
}
?>
</ul>
<i class="icon-th"></i>
</div>
</div>
</div><!-- #parallax-inner -->
</div><!-- #parallax-wrapper -->
<?php } ?>
<div id="content-wrapper" style="margin-top:<?php echo(125+$parallax_height); ?>px">
<div id="content" class="clearfix">
<?php while ( have_posts() ) : the_post(); ?>
<?php if($post->post_excerpt || $post-> post_content) : ?>
<div id="portfolio-template" class="content-column-wrapper clearfix">
<div class="content-column clearfix">
<article <?php post_class('clearfix'); ?>>
<div class="entry-inner clearfix">
<div class="entry-content-wrapper clearfix">
<div class="entry-content clearfix">
<?php the_content(false); ?>
</div>
</div>
</div>
</article>
</div>
</div>
<?php $have_content = ''; ?>
<?php endif; ?>
<?php endwhile; ?>
<div id="portfolio-grid" class="content-column-wrapper clearfix <?php echo($have_content); ?>">
<div class="content-column clearfix">
<?php
if ( get_query_var('paged') ) { $current_paginate_page = get_query_var('paged');}
elseif ( get_query_var('page') ) { $current_paginate_page = get_query_var('page');}
else { $current_paginate_page = 1; }
$wp_query = new WP_Query(
array(
'post_type' => 'portfolio-type',
// 'posts_per_page'=> get_option('posts_per_page'),
'posts_per_page'=> '-1',
'paged' => $current_paginate_page,
)
);
?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'portfolio-format/grid' );
?>
<?php endwhile; ?>
<?php
$wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
$links = "<div id='page-number'>Page ". $current ." of ". $wp_query->max_num_pages."</div>";
if ($wp_query->max_num_pages > 1):
?>
<div id="pagination" class="clearfix">
<?php echo $links; ?>
<div id='page-links'>
<?php echo paginate_links( array(
'current' => $current,
'show_all' => false,
'prev_next' => true,
'total' => $wp_query->max_num_pages,
'base' => @add_query_arg('paged','%#%'),
'format' => '',
'type' => 'plain',
'prev_text' => '<button class="previous"><i class="icon-circle-arrow-left"></i>'.__('Previous Page', 'coffee').'</button>',
'next_text'=> '<button class="next">'.__('Next Page', 'coffee').'<i class="icon-circle-arrow-right"></i></button>' )); ?>
</div>
</div>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div>
</div>
</div><!-- #content -->
<?php get_footer(); ?>
ACC SHELL 2018