Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Work Page
- */
- get_header(); ?>
- <section id="heading">
- <article>
- <?php the_title('<h2>', '</h2>'); ?>
- <ul>
- <li><?php if(function_exists('bcn_display')) { bcn_display(); } ?></li>
- </ul>
- </article>
- </section><!-- /#heading-->
- <section id="container">
- <article id="content">
- <?php if (has_post_thumbnail()) { ?>
- <aside id="banner">
- <?php echo get_the_post_thumbnail($post_id, 'Featured', array(1200,320)); ?>
- </aside><!-- /#banner-->
- <?php } else { ?>
- <!-- Do Nothing -->
- <?php } ?>
- <article>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <?php the_content(); ?>
- <?php endwhile; ?>
- <?php else : ?>
- <h2>Sorry Nothing Found</h2>
- <?php endif; ?>
- <script>
- // Work Page - Smooth Filtering
- jQuery(document).ready(function(){
- var $container = jQuery('.work_items');
- $container.isotope({
- itemSelector : '.work_item',
- animationOptions: {
- duration: 750,
- easing: 'swing',
- queue: false
- }
- });
- var $optionSets = jQuery('#work_nav .work_tags_nav'),
- $optionLinks = $optionSets.find('a');
- $optionLinks.click(function(){
- var $this = jQuery(this);
- // don't proceed if already selected
- if ( $this.hasClass('selected') ) {
- return false;
- }
- var $optionSet = $this.parents('.work_tags_nav');
- $optionSet.find('.selected').removeClass('selected');
- $this.addClass('selected');
- // make option object dynamically, i.e. { filter: '.my-filter-class' }
- var options = {},
- key = $optionSet.attr('data-option-key'),
- value = $this.attr('data-option-value');
- // parse 'false' as false boolean
- value = value === 'false' ? false : value;
- options[ key ] = value;
- if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
- // changes in layout modes need extra logic
- changeLayoutMode( $this, options )
- } else {
- // otherwise, apply new options
- $container.isotope( options );
- }
- return false;
- });
- });
- </script>
- <aside id="work_nav">
- <?php
- $terms = get_terms("post_tag", array('exclude' => '110, 120, 118, 115, 117, 119, 116, 132'));
- $count = count($terms);
- if ( $count > 0 ){
- echo "<ul class='work_tags_nav img_tags'>";
- foreach ( $terms as $term ) {
- $sanitizeTerm = sanitize_title($term->name);
- $term_link = get_terms('name', $term->name, 'post_tag');
- $term_class = preg_replace('/[^A-Za-z0-9-]+/', '_', html_entity_decode($term->name)); // This strips our sepcial characers and spaces, then replaces them with an underscore
- echo '<li><a class="'. $term_class .'">' . $term->name . '.</a></li>';
- }
- echo '<li><a href="#filter" data-option-value=".case_study">case studies.</a></li>';
- echo "</ul>";
- }
- ?>
- <ul class="filter_nav work_tags_nav" data-option-key="filter">
- <li><a href="#filter" data-option-value="*" class="all selected">all.</a></li>
- <?php
- query_posts(array( 'post_type'=> 'work', 'taxonomy' => 'type', 'posts_per_page' => -1 ));
- if ( have_posts() ) : while ( have_posts() ) : the_post();
- $exclude_these_term_ids = array(129, 133, 126, 127, 110, 131, 123, 124, 125);
- $custom_post_tags = get_the_tags();
- if ( $custom_post_tags ) {
- foreach( $custom_post_tags as $tag ) {
- $tags_arr[] = $tag -> name;
- }
- }
- endwhile; endif;
- if( $tags_arr ) {
- $uniq_tags_arr = array_unique( $tags_arr );
- foreach( $uniq_tags_arr as $tag ) {
- // LIST ALL THE TAGS FOR DESIRED POST TYPE
- $sanitizeTag = sanitize_title($tag);
- $tag_link = get_terms('name', $tag, 'post_tag');
- $tag_class = preg_replace('/[^A-Za-z0-9-]+/', '_', html_entity_decode($tag)); // This strips our sepcial characers and spaces, then replaces them with an underscore
- //echo '<li><a class="'.$tag.'" href="'. get_tag_link($tag_link->term_id).'">' .$tag. '.</a></li>';
- echo '<li><a href="#filter" data-option-value=".' . $tag_class . '">' .$tag. '.</a></li>';
- }
- }
- ?>
- </ul>
- </aside><!-- /#work_nav-->
- <?php wp_reset_query(); ?>
- <article class="work_items">
- <?php if ( is_page(99) ) { ?>
- <!-- Show all case studies and portfolio items -->
- <?php get_template_part( 'work', 'all' ); ?>
- <?php } else { ?>
- <?php if ( is_page(819) ) { ?>
- <!-- Show all logos -->
- <?php get_template_part( 'work', 'logos' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1052) ) { ?>
- <!-- Show all print work -->
- <?php get_template_part( 'work', 'print' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1057) ) { ?>
- <!-- Show all vehicle work -->
- <?php get_template_part( 'work', 'vehicle' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1060) ) { ?>
- <!-- Show all digital interactive work -->
- <?php get_template_part( 'work', 'digital' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1063) ) { ?>
- <!-- Show all stationery work -->
- <?php get_template_part( 'work', 'stationery' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1066) ) { ?>
- <!-- Show all outdoor/pop work -->
- <?php get_template_part( 'work', 'outdoor' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1073) ) { ?>
- <!-- Show all non-profit work -->
- <?php get_template_part( 'work', 'nonprofit' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1080) ) { ?>
- <!-- Show all apparel work -->
- <?php get_template_part( 'work', 'apparel' ); ?>
- <?php } else { ?>
- <?php if ( is_page(1083) ) { ?>
- <!-- Show all branding identity work -->
- <?php get_template_part( 'work', 'branding' ); ?>
- <?php } } } } } } } } } } ?>
- </article><!-- /.work_itmes-->
- </article>
- </article><!-- /#content-->
- </section><!-- /#container-->
- <?php get_template_part( 'sidebar', 'pagenav' ); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement