function sf_get_post_media($postID, $media_width, $media_height, $video_height, $use_thumb_content)
 {
     $format = get_post_format($postID);
     $post_media = "";
     if ($format == "image") {
         $post_media = sf_image_post($postID, $media_width, $media_height, $use_thumb_content);
     } else {
         if ($format == "video") {
             $post_media = sf_video_post($postID, $media_width, $video_height, $use_thumb_content);
         } else {
             if ($format == "gallery") {
                 $post_media = sf_gallery_post($postID, $use_thumb_content);
             } else {
                 if ($format == "audio") {
                     $post_media = sf_audio_post($postID);
                 } else {
                     if ($format == "link") {
                         $post_media = sf_link_post($postID);
                     } else {
                         if ($format == "chat") {
                             $post_media = sf_chat_post($postID);
                         }
                     }
                 }
             }
         }
     }
     return $post_media;
 }
Esempio n. 2
0
$media_slider = sf_get_post_meta($post->ID, 'sf_detail_rev_slider_alias', true);
$media_layerslider = sf_get_post_meta($post->ID, 'sf_detail_layer_slider_alias', true);
$custom_media = sf_get_post_meta($post->ID, 'sf_custom_media', true);
$media_width = 1170;
$media_height = null;
if ($custom_media_height != "" && $fw_media_display == "fw-media-title") {
    $media_height = $custom_media_height;
}
if ($fw_media_display == "fw-media-title" || $fw_media_display == "fw-media") {
    $media_width = 1920;
}
$video_height = 658;
$figure_output = '<figure class="media-wrap media-type-' . $media_type . '" itemscope>';
if ($post_format == "standard") {
    if ($media_type == "video") {
        $figure_output .= sf_video_post($post->ID, $media_width, $video_height, $use_thumb_content) . "\n";
    } else {
        if ($media_type == "slider") {
            $figure_output .= sf_gallery_post($post->ID, $use_thumb_content) . "\n";
        } else {
            if ($media_type == "gallery-stacked") {
                $figure_output .= sf_gallery_stacked_post($post->ID, $use_thumb_content) . "\n";
            } else {
                if ($media_type == "layer-slider") {
                    $figure_output .= '<div class="layerslider">' . "\n";
                    if ($media_slider != "") {
                        $figure_output .= do_shortcode('[rev_slider ' . $media_slider . ']') . "\n";
                    } else {
                        $figure_output .= do_shortcode('[layerslider id="' . $media_layerslider . '"]') . "\n";
                    }
                    $figure_output .= '</div>' . "\n";