Exemplo n.º 1
0
?>
>

            <?php 
if (has_post_thumbnail() && !post_password_required()) {
    ?>

                <a href="<?php 
    the_permalink();
    ?>
" class="image-post">

                    <?php 
    // Let's grab the video URL
    $post_thumbnail_id = get_post_thumbnail_id();
    $post_attachment = zen_get_attachment($post_thumbnail_id);
    // Now let's test if we have a video URL
    if ($post_attachment['video_url'] != '') {
        // Display the video
        echo wp_oembed_get($post_attachment['video_url'], array('height' => '350'));
    } else {
        // Display the featured image of the post
        the_post_thumbnail('custom_blog_image_1');
    }
    ?>

                </a>

            <?php 
}
?>
Exemplo n.º 2
0
 function zen_the_post_rs($attachments, $options = array())
 {
     $output = '';
     // If we have some images, build the slider
     if ((int) $attachments['count'] != 0) {
         foreach ($attachments['images'] as $image) {
             $img_details = zen_get_attachment($image->ID);
             if ($img_details['video_url'] != '') {
                 $output .= '<a class="rsImg" href="' . $img_details['src'] . '" data-rsVideo="' . $img_details['video_url'] . '" alt="' . $img_details['caption'] . '" /></a>';
             } else {
                 $output .= '<img class="rsImg" data-rsBigImg="' . $img_details['src'] . '" src="' . $img_details['src'] . '" alt="' . $img_details['caption'] . '" />';
             }
         }
         $output = ' <div class="rsZenPortfolioSingle rsDefault">' . $output . '</div>';
     }
     return $output;
 }