Viewing File: /home/maglabs/2vsa/wp-content/themes/cargohub/parts/content-project.php
<?php
/**
* @package CargoHub
*/
$class = 'project-wrapper';
$size = 'cargohub-project-grid-thumb';
$gallery = get_post_meta( get_the_ID(), 'images', false );
$columns = cargohub_get_option( 'project_columns' );
$col = 12 / intval($columns);
if ( 'no-sidebar' != cargohub_get_layout() && $columns == '4' ) {
$class .= ' col-xs-12 col-sm-12 col-md-4 col-3';
} else {
$class .= ' col-xs-12 col-sm-12 col-md-' . $col . ' col-' . intval($columns);
}
?>
<div id="post-<?php the_ID(); ?>" <?php post_class( $class ); ?>>
<div class="project-thumbnail">
<a href="<?php the_permalink() ?>" class="pro-link"></a>
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail( $size ) ?></a>
<div class="project-button">
<a href="<?php the_post_thumbnail_url( 'full' ); ?>" class="button-link fancybox" rel="project-gallery-<?php the_ID(); ?>" data-fancybox="gallery"><i class="fa fa-search-plus" aria-hidden="true"></i></a>
<?php
if ( $gallery ) {
foreach ( $gallery as $image ) {
$image_full = wp_get_attachment_image_src( $image, 'full' );
if ( $image_full ) {
printf(
'<a class="fancybox" href="%s" rel="project-gallery-%s" data-fancybox="gallery">',
esc_url( $image_full[0] ),
get_the_ID()
);
}
}
} else {
$gallery = get_post_thumbnail_id( get_the_ID() );
$image_full = wp_get_attachment_image_src( $gallery, 'full' );
if ( $image_full ) {
printf(
'<a class="fancybox" href="%s" rel="project-gallery-%s" data-fancybox="gallery"></a>',
esc_url( $image_full[0] ),
get_the_ID()
);
}
}
?>
<a href="<?php the_permalink() ?>" class="button-link"><i class="fa fa-link" aria-hidden="true"></i></a>
</div>
</div>
</div><!-- #project-## -->
Back to Directory
File Manager