<?php
$data = $postMeta->getOption( $currentPostId, 'portfolio_options');
$postQuery = $fwc->getOptionsFactory()->createQuery( $data,'ffComponent_Theme_MetaboxPortfolio_CategoryView');
$featured_img_nonresized = wp_get_attachment_url( get_post_thumbnail_id( $currentPostId ) );
if( $featured_img_nonresized == false ) {
return;
}
$featured_img = fImg::resize( $featured_img_nonresized, 623,388,true);
$type = $postQuery->get('general showcase-type');
$linkClass = '';
$linkHref = '';
if( $type == 'lightbox' ) {
$linkClass = 'fancybox';
$linkHref = $postQuery->getIndex('general slides', 0)
->getImage('image')
->url;
if( empty( $linkHref ) ) {
$linkHref = $featured_img_nonresized;
}
} else if ( $type == 'page' ) {
$linkClass = 'work-ext-link';
$linkHref = get_permalink( $currentPostId );
} else if( $type == 'expander' ) {
$linkClass = 'work-ajax-link';
$linkHref = $currentPostId;
}
$tags = array();
$t = wp_get_post_terms( $currentPostId, 'ff-portfolio-tag' );
if( !empty($t) ) foreach ($t as $onePortfolioTag) {
$tags[] = 'tag-'.esc_attr( $onePortfolioTag->term_id );
}
$tags = implode(' ', $tags);
?>
<!-- Work Item (Lightbox) -->
<li class="work-item mix <?php echo esc_attr( $tags ); ?>">
<a href="<?php echo ( $linkHref ); ?>" class="<?php echo esc_attr( $linkClass ); ?>">
<div class="port-img fancybox" rel="gallery">
<img src="<?php echo esc_url( $featured_img ); ?>" alt="Work"/><br/>
<?php $postQuery->printText('general description-small'); ?>
</div>
<div class="work-intro">
<h3 class="work-title"><?php $postQuery->printText('general title'); ?></h3>
<div class="work-descr">
<?php $postQuery->printText('general description-small'); ?>
</div>
</div>
</a>
</li>
<!-- End Work Item -->