| Server IP : 198.38.94.67 / Your IP : 216.73.217.142 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/azfilmst/alizamani.com/wp-content/themes/scena/template-parts/ |
Upload File : |
<?php
$style = get_query_var( 'portfolio_style' );
$secondary = themerain_meta( 'project_thumbnail_secondary' );
$video = themerain_meta( 'project_thumbnail_video' );
$poster = '';
$classes = '';
$enable_autoplay = get_theme_mod( 'enable_video_autoplay' );
$enable_lazyload = ( get_query_var( 'portfolio_current_item' ) === 0 && 'slider' === $style ) ? false : true;
$data_autoplay = $enable_lazyload ? ' data-autoplay' : ' autoplay';
$autoplay = ( 'slider' === $style || $enable_autoplay ) ? $data_autoplay : '';
$url = get_the_permalink();
$url_type = themerain_meta( 'project_link_type' );
$url_data = '';
if ( 'image' === $url_type ) {
$url = wp_get_attachment_url( themerain_meta( 'project_link_image' ) );
$url_data = ' data-fancybox data-no-swup';
} elseif ( 'video' === $url_type ) {
$url = themerain_meta( 'project_link_video' );
$url_data = ' data-fancybox data-no-swup';
} elseif ( 'url' === $url_type ) {
$url = themerain_meta( 'project_link_url' );
}
if ( $video && 'slider' !== $style ) {
$classes .= ' has-video';
}
if ( $video && ! $enable_autoplay && 'slider' !== $style ) {
$classes .= ' has-hover-video';
}
if ( $secondary && ! $video ) {
$classes .= ' has-secondary-thumbnail';
}
?>
<div <?php post_class( esc_attr( $classes ) ); ?>>
<div class="project-thumbnail">
<div class="project-thumbnail-inner"<?php if ( 'slider' === $style ) echo 'data-swiper-parallax="25%"'; ?>>
<?php
if ( $video ) {
if ( has_post_thumbnail() ) {
$data_poster = $enable_lazyload ? ' data-poster="' : ' poster="';
$poster = $data_poster . esc_url( wp_get_attachment_url( get_post_thumbnail_id() ) ) . '"';
}
$video_class = $enable_lazyload ? 'class="lazyload"' : '';
$video_preload = $enable_lazyload ? 'preload="none"' : '';
echo '<video ' . $video_class . ' src="' . esc_url( wp_get_attachment_url( $video ) ) . '"' . $poster . ' ' . $video_preload . ' muted loop playsinline' . $autoplay . '></video>';
if ( ! $enable_autoplay && has_post_thumbnail() && ( 'grid' === $style || 'carousel' === $style ) ) {
echo themerain_get_image( get_post_thumbnail_id() );
}
} elseif ( has_post_thumbnail() ) {
echo themerain_get_image( get_post_thumbnail_id() );
if ( $secondary ) {
echo '<div class="project-thumbnail-secondary">';
echo themerain_get_image( $secondary );
echo '</div>';
}
}
?>
</div>
</div>
<div class="project-caption">
<?php
if ( 'none' === $url_type ) {
the_title( '<h3' . ( 'slider' === $style ? ' data-swiper-parallax="20%"' : '' ) . '><span>', '</span></h3>' );
} else {
the_title( '<h3' . ( 'slider' === $style ? ' data-swiper-parallax="20%"' : '' ) . '><a href="' . esc_url( $url ) . '"' . esc_attr( $url_data ) . '><span>', '</span></a></h3>' );
}
if ( has_excerpt() ) the_excerpt();
?>
</div>
</div>