<?php

/**
 * Portfolio single media template part
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Get portfolio video
$video = wpex_get_portfolio_post_video();
// Get portfolio attachment ( gallery images )
$attachments = wpex_get_gallery_ids(get_the_ID());
// Get portfolio thumbnail
$thumbnail = !$video ? wpex_get_portfolio_post_thumbnail() : '';
?>

<div id="portfolio-single-media" class="clr">

    <?php 
// Display slider if there are $attachments
if ($attachments) {
    get_template_part('partials/portfolio/portfolio-single-gallery');
    // Display Post Video if defined
} elseif ($video) {
    ?>
    
Пример #2
0
 function wpex_portfolio_post_video($post_id = '', $video = false)
 {
     echo wpex_get_portfolio_post_video();
 }