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 }