Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
                    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";
                } else {
                    if ($media_type == "audio") {
                        $figure_output .= '<div class="audio-detail">' . sf_audio_post($post->ID, $use_thumb_content) . '</div>' . "\n";
                    } else {
                        if ($media_type == "sh-video") {
                            $figure_output .= '<div class="sh-video-wrap">' . sf_sh_video_post($post->ID, $use_thumb_content) . '</div>' . "\n";
                        } else {
                            if ($media_type == "custom") {
                                $figure_output .= do_shortcode($custom_media) . "\n";
                            } else {
                                if ($media_type == "image") {
                                    $figure_output .= sf_image_post($post->ID, $media_width, $media_height, $use_thumb_content) . "\n";
                                }
                            }
                        }
                    }
                }
            }
        }
    }
} else {
    $figure_output .= sf_get_post_media($post->ID, $media_width, $media_height, $video_height, $use_thumb_content);
}
$figure_output .= '</figure>' . "\n";
echo $figure_output;
Exemplo n.º 3
0
    function sf_post_detail_media()
    {
        global $post, $sf_options, $sf_sidebar_config;
        $single_author = $sf_options['single_author'];
        $remove_dates = $sf_options['remove_dates'];
        $bg_color_title = sf_get_post_meta($post->ID, 'sf_bg_color_title', true);
        $bg_opacity_title = sf_get_post_meta($post->ID, 'sf_bg_opacity_title', true);
        if (!$bg_color_title) {
            $bg_color_title = "transparent";
            $bg_opacity_title = "0";
        }
        $media_type = sf_get_post_meta($post->ID, 'sf_media_type', true);
        $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
        $details_overlay_styling = "";
        $details_overlay_color = sf_get_post_meta($post->ID, 'sf_title_overlay_text_color', true);
        if ($details_overlay_color != "") {
            $details_overlay_styling = 'style="color: ' . $details_overlay_color . '"';
        }
        $pb_active = sf_get_post_meta($post->ID, '_spb_js_status', true);
        $post_author = get_the_author_link();
        $post_date = get_the_date();
        $post_date_str = get_the_date('Y-m-d');
        $post_categories = get_the_category_list(', ');
        if ($media_type == "none") {
            return;
        }
        if (is_singular('directory')) {
            $fw_media_display = "standard";
        }
        if ($fw_media_display == "fw-media-title" && $media_type != "none") {
            remove_action('sf_post_article_start', 'sf_post_detail_heading', 0);
            $use_thumb_content = sf_get_post_meta($post->ID, 'sf_thumbnail_content_main_detail', true);
            $custom_media_height = sf_get_post_meta($post->ID, 'sf_media_height', true);
            $media_height = null;
            if ($custom_media_height != "") {
                $media_height = $custom_media_height;
            } else {
                $custom_media_height = 0;
            }
            $image_url = sf_image_post($post->ID, 1920, $media_height, $use_thumb_content, true);
            ?>
                <div class="detail-feature"
                     style="background-image: url(<?php 
            echo esc_url($image_url);
            ?>
); min-height: <?php 
            echo esc_attr($custom_media_height);
            ?>
px;">
                   <span class="media-overlay" style="background-color:<?php 
            echo $bg_color_title;
            ?>
;opacity:<?php 
            echo $bg_opacity_title / 100;
            ?>
;"></span>
                    <div class="details-overlay">
                        <h1 class="entry-title"
                            itemprop="name" <?php 
            echo $details_overlay_styling;
            ?>
><?php 
            the_title();
            ?>
</h1>
                        <?php 
            if ($single_author && !$remove_dates) {
                ?>
                            <div
                                class="post-item-details" <?php 
                echo $details_overlay_styling;
                ?>
><?php 
                echo sprintf(__('In %1$s on <time datetime="%2$s" itemprop="datePublished" class="updated">%3$s</time>', 'swiftframework'), $post_categories, $post_date_str, $post_date);
                ?>
</div>
                        <?php 
            } else {
                if (!$remove_dates) {
                    ?>
                            <div
                                class="post-item-details" <?php 
                    echo $details_overlay_styling;
                    ?>
><?php 
                    echo sprintf(__('<span class="vcard author">By <span itemprop="author" class="fn">%1$s</span></span> in %2$s <time class="date updated" datetime="%3$s" itemprop="datePublished">%4$s</time>', 'swiftframework'), $post_author, $post_categories, $post_date_str, $post_date);
                    ?>
</div>
                        <?php 
                } else {
                    if (!$single_author) {
                        ?>
                            <div
                                class="post-item-details" <?php 
                        echo $details_overlay_styling;
                        ?>
><?php 
                        echo sprintf(__('<span class="vcard author">By <span itemprop="author" class="fn">%1$s</span></span> in %2$s', 'swiftframework'), $post_author, $post_categories);
                        ?>
</div>
                        <?php 
                    }
                }
            }
            ?>
                    </div>
                </div>
            <?php 
        } else {
            if ($fw_media_display == "fw-media") {
                sf_get_template('detail-media');
            } else {
                if ($pb_active != "true" && !$fw_media_display == "standard") {
                    ?>
                <?php 
                    sf_get_template('detail-media');
                    ?>
            <?php 
                } else {
                    ?>
                <div class="container">
                    <?php 
                    sf_get_template('detail-media');
                    ?>
                </div>
            <?php 
                }
            }
        }
    }