EstudioJuridicoAlmagro_Web/www/single-portfolio.php
2013-03-01 18:06:10 +00:00

124 lines
3.6 KiB
PHP

<?php
/**
* @package WordPress
* @subpackage Progressio
*/
$layout_type = wpv_post_default('layout-type', 'default-body-layout');
if(empty($layout_type)) {
$layout_type = 'full';
}
switch($layout_type) {
case 'left-only':
define('WPV_LAYOUT', 'left-sidebar');
break;
case 'right-only':
define('WPV_LAYOUT', 'right-sidebar');
break;
case 'two-sidebars':
define('WPV_LAYOUT', 'two-sidebars');
break;
case 'full':
define('WPV_LAYOUT', 'no-sidebars');
break;
}
get_header(); ?>
<?php if(get_post_meta(get_the_id(), 'show_page_header', true) != 'false'): ?>
<header class="page-header">
<h1><?php the_title();?></h1>
<?php
$page_desc = get_post_meta(get_the_id(), 'description', true);
if(!empty($page_desc)):
?>
<div class="description"><?php echo $page_desc?></div>
<?php endif ?>
</header>
<?php endif ?>
<?php
global $wpv_has_header_sidebars;
if( $wpv_has_header_sidebars) {
get_sidebar('header');
}
?>
<div class="clearfix page-wrapper">
<?php if($layout_type == 'left-only' || $layout_type == 'left-right'): ?>
<aside class="left">
<?php get_sidebar('left'); ?>
</aside>
<?php endif ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php $rel_group = 'portfolio_'.get_the_ID() ?>
<?php extract(wpv_get_portfolio_options('true', $rel_group)) ?>
<article id="post-<?php the_ID(); ?>" <?php post_class($layout_type); ?>>
<?php
$column_width = wpv_get_central_column_width();
$size = array(intval(0.7 * $column_width) -28, 0);
?>
<div class="portfolio_image_wrapper">
<?php if($type != 'video'): ?>
<a class="portfolio_image <?php echo $lightbox?> thumbnail <?php echo $type?>" <?php if(isset($link_target)) echo 'target="'.$link_target.'"'; ?> href="<?php echo $href?>" <?php echo $rel.$width.$height.$iframe?>>
<span class="graphic-label-big>"></span>
<?php
wpv_lazy_load( wpv_resize_image($image[0], $size[0], $size[1]), get_the_title(), array(
'width' => $size[0],
)); ?>
</a>
<?php else: ?>
<?php wpv_post_video($size[0], null, $href) ?>
<?php endif ?>
<div class="shadow"></div>
<?php if($type == 'gallery'):
$image_ids = get_post_meta(get_the_id(), 'gallery_ids', true);
$image_ids = explode(',', str_replace('image-', '', $image_ids));
// these two set the gallery thumbnails' size and count
$per_line = 5;
$between = 10;
$small_size = intval(($size[0] + 4 - $between*($per_line-1) )/ $per_line);
foreach($image_ids as $num=>$image_id):
$image = wp_get_attachment_image_src($image_id,'full');
$image = $image[0];
?><a class="portfolio-small lightbox thumbnail <?php if($num % $per_line ==0) echo " first-in-line"?>" href="<?php echo $image ?>" <?php echo $rel?>><?php
wpv_lazy_load(wpv_resize_image($image, $small_size, $small_size), get_the_title(), array(
'width' => $small_size,
'height' => $small_size,
));
?></a><?php
endforeach;
endif;
?>
</div>
<div class="portfolio_details project-info-pad folio single">
<div class="portfolio_desc">
<?php the_content()?>
</div>
</div>
<?php //wpv_post_siblings_links() ?>
<div class="clearboth">
<?php wpv_share('portfolio'); ?>
</div>
</article>
<?php endwhile ?>
<?php if($layout_type == 'right-only' || $layout_type == 'left-right'): ?>
<aside class="right">
<?php get_sidebar('right'); ?>
</aside>
<?php endif ?>
</div>
<?php get_footer(); ?>