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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
| <?php
/*
*Template Name: Portfolio
*
* @package WordPress
* @subpackage Maxx
*
*/
?>
<?php get_header()?>
<?php
$porfolio_featured_image_height = $data['md_porfolio_featured_image_height'];
?>
<!--main content-->
<div id="main-content-wrapper" class="fixed-width-wrapper" >
<!--Breadcums-->
<?php if ($data['md_show_breadcums'] && class_exists('simple_breadcrumb')){?>
<div id="breadcrumb-wrapper" class="float-left">
<?php $breadcrumbs = new simple_breadcrumb; ?>
</div>
<?php }?>
<!--/Breadcums-->
<!--Page title-->
<h1 class="page-title cufon first-word double-color"><?php /*?><?php echo $data['md_portfolio_page_title'] ?><?php */?></h1>
<!--/Page title-->
<div class="clear"></div>
<!--content-->
<div id="content" class="portfolio-page">
<article <?php post_class('post-entry') ?> id="post-<?php the_ID(); ?>">
<script language="javascript">
jQuery(document).ready(function($) {
// cache container
var $container = jQuery('#portfolio-items');
// initialize isotope
$container.isotope({
animationEngine : 'best-available',
animationOptions: {
duration: 200,
easing: 'easeInOutQuad',
queue: false
},
layoutMode : '<?php echo $data['md_portfolio_layout'];?>'//fitRows,
});
// filter items when filter link is clicked
jQuery('#portfolio-filter li a').click(function(){
jQuery('#portfolio-filter li a').removeClass('active');
jQuery(this).addClass('active');
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
});
</script>
<!--Portfolio filter-->
<ul id="portfolio-filter">
<li></li>
<?php wp_list_categories(array('title_li' => '', 'taxonomy' => 'portfolio-type', 'walker' => new Portfolio_Walker())); ?>
</ul>
<!--/Portfolio filter-->
<div class="clear"></div>
<!--Portfolio items-->
<div id="portfolio-items-wrapper">
<div id="portfolio-items" class="portfolio-<?php echo $data['md_porfolio_columns']?>-columns">
<?php $args = array( 'post_type' => 'portfolio', 'posts_per_page' => -1,'orderby' => 'menu_order','order' => 'ASC');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php $terms = get_the_terms( get_the_ID(), 'portfolio-type' ); ?>
<?php
//Get the thumbnail url
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'full', true);
//Custom feature image size from theme option
$feature_image_url = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post->ID ), 'portfolio-thumb' );
$feature_image_resized = '';
if($porfolio_featured_image_height){
$feature_image_resized = '/functions/thumb.php?src=' . $feature_image_url[0].'&w=282&h='.$porfolio_featured_image_height;
}
//Get the data from custom metabox field
$media_type = get_post_meta($post->ID, 'md_portfolio_type', true);
$video_type = get_post_meta($post->ID, 'md_video_type', true);
$video_embed_code_id = get_post_meta($post->ID, 'md_portfolio_video_embed_code_id', true);
//check type of video
$current_video_link = "";
if($video_type == 'Vimeo'){
$current_video_link = 'http://vimeo.com/'.$video_embed_code_id;
}
else{
$current_video_link = 'http://www.youtube.com/watch?v='.$video_embed_code_id;
}
?>
<!--project entry-->
<article class="project-entry <?php if(is_array($terms)) : foreach ($terms as $term) { echo $term->slug.' '; } endif; ?>" id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail()) { ?>
<a href="<?php if(($media_type == 'video') && ($video_embed_code_id != "") ){?><?php echo $current_video_link ?><?php }else{?><?php echo $image_url[0]; ?><?php }?>" title="<?php the_title(); ?>" rel="prettyPhoto[<?php echo 'term'.$term->term_id; ?>]" class="img-border align-none project-thumbnail <?php echo $media_type;?>-preview">
<?php if($porfolio_featured_image_height){?>
<img src="<?php echo get_template_directory_uri() . $feature_image_resized;?>" alt="<?php the_title(); ?>">
<?php }else{?>
<?php the_post_thumbnail('portfolio-thumb'); ?>
<?php }?>
</a>
<?php }?>
<?php
// Porfolio Columns from theme settings
if($data['md_porfolio_columns'] == '3'){?>
<h4 class="cufon first-word"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h4>
<?php }else{?>
<h5 class="cufon first-word"><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h5>
<?php } ?>
<?php
//enable excerpt
if ($data['md_enable_portfolio_excerpt']) { ?>
<?php the_excerpt();?>
<?php }?>
<?php
//readmore button
if ($data['md_hide_preadmore_button']) { ?>
<a href="<?php the_permalink();?>" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>" class="read-more"><?php _e('Read more','framework')?></a>
<?php }?>
<div class="sp"></div>
<div class="clear"></div>
</article>
<!--/project entry-->
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
<!--/Portfolio items-->
</article>
</div>
<!--/Content-->
</div>
<!--/main content-->
<?php get_footer()?> |
Partager