function sf_campaign_detail_media()
    {
        global $post, $wp_embed;
        $end_date = "";
        $campaign = new ATCF_Campaign($post->ID);
        $type = $campaign->type();
        $post_date = get_the_date();
        $post_date_str = get_the_date('Y-m-d');
        if (!$campaign->is_endless()) {
            $end_date = date_i18n(get_option('date_format'), strtotime($campaign->end_date()));
        }
        $image = wp_get_attachment_url(get_post_thumbnail_id());
        $share_text = apply_filters('sf_post_share_text', __("Share this", "swiftframework"));
        ?>
            <div class="campaign-detail row">
                <div class="col-sm-8">
                    <?php 
        if ($campaign->video()) {
            ?>
                        <figure class="video-container">
                            <?php 
            echo $wp_embed->run_shortcode('[embed]' . $campaign->video() . '[/embed]');
            ?>
                        </figure>
                    <?php 
        } else {
            ?>
                        <?php 
            sf_get_template('detail-media');
            ?>
                    <?php 
        }
        ?>
                </div>
                <div class="col-sm-4">
                    <div class="campaign-details">
                        <div class="detail">
                            <data><?php 
        echo esc_attr($campaign->backers_count());
        ?>
</data>
                            <span><?php 
        echo _n('Backer', 'Backers', $campaign->backers_count(), 'swiftframework');
        ?>
</span>
                        </div>
                        <div class="detail pledged">
                            <data><?php 
        echo esc_attr($campaign->current_amount());
        ?>
</data>
                            <span><?php 
        printf(__('Pledged of %s Goal', 'swiftframework'), $campaign->goal());
        ?>
</span>
                        </div>
                        <?php 
        if (!$campaign->is_endless()) {
            ?>
                            <div class="detail">
                                <data><?php 
            echo esc_attr($campaign->days_remaining());
            ?>
</data>
                                <span><?php 
            echo _n('Day to Go', 'Days to Go', $campaign->days_remaining(), 'swiftframework');
            ?>
</span>
                            </div>
                        <?php 
        }
        ?>
                    </div>
                    <a href="#back-this-project"
                       class="back-this sf-button accent smooth-scroll-link"><?php 
        _e('Back this project', 'swiftframework');
        ?>
</a>
                    <h5 class="fund">
                        <?php 
        if ($type == 'fixed') {
            printf(__('This %3$s will only be funded if at least %1$s is pledged by %2$s.', 'swiftframework'), $campaign->goal(), $end_date, strtolower(edd_get_label_singular()));
        } else {
            if ($type == 'flexible') {
                printf(__('All funds will be collected on %1$s.', 'swiftframework'), $end_date);
            } else {
                if (!$campaign->is_endless()) {
                    printf(__('All pledges will be collected automatically until %1$s.', 'swiftframework'), $end_date);
                }
            }
        }
        ?>
                    </h5>

                    <div class="campaign-meta">
                        <time class="date" datetime="<?php 
        echo esc_attr($post_date_str);
        ?>
">
                            <span><?php 
        _e('Launched', 'swiftframework');
        ?>
</span><?php 
        echo esc_attr($post_date);
        ?>
</time>
                        <?php 
        if (!$campaign->is_endless()) {
            ?>
                            <div class="funding-ends">
                                <span><?php 
            _e('Funding Ends', 'swiftframework');
            ?>
</span><?php 
            echo esc_attr($end_date);
            ?>
                            </div>
                        <?php 
        }
        ?>
                        <?php 
        if ($campaign->location()) {
            ?>
                            <div class="location">
                                <span><?php 
            _e('Location', 'swiftframework');
            ?>
</span><?php 
            echo esc_attr($campaign->location());
            ?>
                            </div>
                        <?php 
        }
        ?>
                    </div>
                </div>
            </div>
        <?php 
    }
Beispiel #2
0
    function sf_base_layout($template, $type = "")
    {
        global $post, $sf_options;
        $sidebar_var = sf_base_sidebar($type);
        $sidebar_config = $sidebar_var['config'];
        $left_sidebar = $sidebar_var['left'];
        $right_sidebar = $sidebar_var['right'];
        $page_wrap_class = $sidebar_var['page_wrap_class'];
        $remove_bottom_spacing = $remove_top_spacing = $sidebar_progress_menu = "";
        $pb_fw_mode = true;
        $pb_active = false;
        if ($post) {
            $pb_active = sf_get_post_meta($post->ID, '_spb_js_status', true);
        }
        if ($sidebar_config != "no-sidebars" || $pb_active != "true") {
            $pb_fw_mode = false;
        }
        if ($post && !is_search() && is_singular()) {
            $remove_bottom_spacing = sf_get_post_meta($post->ID, 'sf_no_bottom_spacing', true);
            $remove_top_spacing = sf_get_post_meta($post->ID, 'sf_no_top_spacing', true);
            $sidebar_progress_menu = sf_get_post_meta($post->ID, 'sf_sidebar_progress_menu', true);
        }
        if ($remove_bottom_spacing) {
            $page_wrap_class .= ' no-bottom-spacing';
        }
        if ($remove_top_spacing) {
            $page_wrap_class .= ' no-top-spacing';
        }
        if ($sidebar_progress_menu == "left-sidebar" || $sidebar_progress_menu == "right-sidebar") {
            $pb_fw_mode = false;
        }
        $cont_width = $sidebar_width = "";
        if ($sf_options['sidebar_width'] == "reduced") {
            $cont_width = apply_filters("sf_base_layout_cont_width_reduced", "col-sm-9");
            $sidebar_width = apply_filters("sf_base_layout_cont_width_reduced_sidebar", "col-sm-3");
        } else {
            $cont_width = apply_filters("sf_base_layout_cont_width", "col-sm-8");
            $sidebar_width = apply_filters("sf_base_layout_cont_width_sidebar", "col-sm-4");
        }
        ?>

        <?php 
        if (!$remove_top_spacing) {
            if ($pb_fw_mode || $sidebar_config != "no-sidebars") {
                ?>
					<div class="content-divider-wrap container"><div class="content-divider sf-elem-bb"></div></div>
				<?php 
            } else {
                ?>
					<div class="content-divider-wrap"><div class="content-divider sf-elem-bb"></div></div>
				<?php 
            }
        }
        ?>

        <div class="inner-page-wrap <?php 
        echo esc_attr($page_wrap_class);
        ?>
 clearfix">

            <!-- OPEN page -->
            <?php 
        if ($sidebar_config == "left-sidebar") {
            ?>
            <div class="<?php 
            echo esc_attr($cont_width);
            ?>
 push-right clearfix">
            <?php 
        } else {
            if ($sidebar_config == "right-sidebar") {
                ?>
            <div class="<?php 
                echo esc_attr($cont_width);
                ?>
 clearfix">
            <?php 
            } else {
                if ($sidebar_config == "both-sidebars") {
                    ?>
            <div class="col-sm-9 clearfix">
            <?php 
                } else {
                    ?>
            <div class="clearfix">
        <?php 
                }
            }
        }
        ?>

            <?php 
        if ($sidebar_config == "both-sidebars") {
            ?>
                <div class="row">

                    <div class="page-content col-sm-8 hfeed clearfix">

                        <?php 
            sf_get_template($template, $type);
            ?>

                    </div>

                    <aside class="sidebar left-sidebar col-sm-4">

                        <?php 
            do_action('sf_before_sidebar');
            ?>
                        <?php 
            do_action('sf_before_left_sidebar');
            ?>

                        <div class="sidebar-widget-wrap sticky-widget">
                            <?php 
            dynamic_sidebar($left_sidebar);
            ?>
                        </div>

                        <?php 
            do_action('sf_after_sidebar');
            ?>

                    </aside>

                </div>
            <?php 
        } else {
            ?>

                <div class="page-content hfeed clearfix">

                    <?php 
            sf_get_template($template, $type);
            ?>

                </div>

            <?php 
        }
        ?>

            <!-- CLOSE page -->
            </div>

            <?php 
        if ($sidebar_config == "left-sidebar") {
            ?>

                <aside class="sidebar left-sidebar <?php 
            echo esc_attr($sidebar_width);
            ?>
">

                    <?php 
            do_action('sf_before_sidebar');
            ?>
                    <?php 
            do_action('sf_before_left_sidebar');
            ?>

                    <div class="sidebar-widget-wrap sticky-widget">
                        <?php 
            dynamic_sidebar($left_sidebar);
            ?>
                    </div>

                    <?php 
            do_action('sf_after_sidebar');
            ?>

                </aside>

            <?php 
        } else {
            if ($sidebar_config == "right-sidebar") {
                ?>

                <aside class="sidebar right-sidebar <?php 
                echo esc_attr($sidebar_width);
                ?>
">

                    <?php 
                do_action('sf_before_sidebar');
                ?>
                    <?php 
                do_action('sf_before_right_sidebar');
                ?>

                    <div class="sidebar-widget-wrap sticky-widget">
                        <?php 
                dynamic_sidebar($right_sidebar);
                ?>
                    </div>

                    <?php 
                do_action('sf_after_sidebar');
                ?>

                </aside>

            <?php 
            } else {
                if ($sidebar_config == "both-sidebars") {
                    ?>


                <aside class="sidebar right-sidebar col-sm-3">

                    <?php 
                    do_action('sf_before_sidebar');
                    ?>
                    <?php 
                    do_action('sf_before_right_sidebar');
                    ?>

                    <div class="sidebar-widget-wrap sticky-widget">
                        <?php 
                    dynamic_sidebar($right_sidebar);
                    ?>
                    </div>

                    <?php 
                    do_action('sf_after_sidebar');
                    ?>

                </aside>

            <?php 
                }
            }
        }
        ?>

            </div>

        <?php 
    }
    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 
                }
            }
        }
    }