Пример #1
0
/**
 * Add data to the vcex_gitem_post_video shortcode
 *
 * @since 1.4.1
 */
function vc_gitem_template_attribute_vcex_post_video($value, $data)
{
    // Extract data
    extract(array_merge(array('output' => '', 'post' => null, 'data' => ''), $data));
    // Get and extract shortcode attributes
    $atts = array();
    parse_str($data, $atts);
    extract(shortcode_atts(array('post_id' => '', 'css' => ''), $atts));
    // Get post id
    $post_id = !empty($post_id) ? $post_id : $post->ID;
    // Get video
    $video = wpex_get_post_video($post_id);
    $video = $video ? wpex_get_post_video_html($video) : '';
    if ($video) {
        // Custom CSS
        if ($css) {
            $css = ' ' . vc_shortcode_custom_css_class($css);
        }
        // Generate output
        $output .= '<div class="vcex-gitem-post-video wpex-clear' . $css . '">';
        $output .= $video;
        $output .= '</div><!-- .vcex-gitem-post-video -->';
        // Return output
        return $output;
    }
}
Пример #2
0
    // Loop through posts
    $count = '0';
    while ($wpex_query->have_posts()) {
        // Get post from query
        $wpex_query->the_post();
        // Add to counter
        $count++;
        // Create new post object.
        $post = new stdClass();
        // Post VARS
        $post->ID = get_the_ID();
        $post->permalink = wpex_get_permalink($post->ID);
        $post->the_title = get_the_title($post->ID);
        $post->the_title_esc = esc_attr(the_title_attribute('echo=0'));
        $post->type = get_post_type($post->ID);
        $post->video_embed = wpex_get_post_video_html();
        $post->format = get_post_format($post->ID);
        ?>

			<?php 
        if ($grid_columns > '1') {
            ?>
				<div class="col span_1_of_<?php 
            echo $grid_columns;
            ?>
 vcex-recent-news-entry-wrap col-<?php 
            echo $count;
            ?>
">
			<?php 
        }
 // Post Data
 $post->ID = $get_post->ID;
 $post->title = $get_post->post_title;
 $post->permalink = wpex_get_permalink($post->ID);
 $post->format = get_post_format($post->ID);
 $post->excerpt = '';
 // Post Excerpt
 if ('true' == $excerpt) {
     $post->excerpt = wpex_get_excerpt(array('length' => intval($excerpt_length)));
 }
 // Counter
 $count++;
 // Get video
 if ('video' == $post->format) {
     $post->video = wpex_get_post_video($post->ID);
     $post->video_oembed = wpex_get_post_video_html($post->video);
 }
 // Entry Classes
 $entry_classes = array('vcex-blog-entry');
 $entry_classes[] = 'span_1_of_' . $columns;
 $entry_classes[] = 'col-' . $count;
 if ('false' == $columns_responsive) {
     $entry_classes[] = 'nr-col';
 } else {
     $entry_classes[] = 'col';
 }
 if ($is_isotope) {
     $entry_classes[] = 'vcex-isotope-entry';
 }
 if ($css_animation) {
     $entry_classes[] = $css_animation;
Пример #4
0
/**
 * Displays the portfolio featured video
 *
 * @since 1.5.2
 */
function wpex_get_portfolio_post_video()
{
    // Get video URl
    $video = wpex_get_post_video_html();
    // Return if no video
    if (empty($video)) {
        return;
    }
    // Return video
    return '<div class="portfolio-featured-video clr">' . $video . '</div>';
}
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Display videos
if (wpex_get_mod('blog_entry_video_output')) {
    ?>

	<?php 
    // Get post video
    $video = wpex_get_post_video_html();
    ?>

	<?php 
    // Display video if one exists and it's not a password protected post
    if ($video && !post_password_required()) {
        ?>

		<div class="blog-entry-media entry-media clr">

			<div class="blog-entry-video">

				<?php 
        echo $video;
        ?>
Пример #6
0
/**
 * Echo post video HTML
 *
 * @since 2.0.0
 */
function wpex_post_video_html($video = '')
{
    echo wpex_get_post_video_html($video);
}
Пример #7
0
 // Define counter var to clear floats
 $count = 0;
 // Start loop
 while ($wpex_query->have_posts()) {
     // Get post from query
     $wpex_query->the_post();
     // Create new post object
     $post = new stdClass();
     // Get post data
     $get_post = get_post();
     // Post Data
     $post->ID = $get_post->ID;
     $post->permalink = wpex_get_permalink($post->ID);
     $post->title = $get_post->post_title;
     $post->video = wpex_get_post_video($post->ID);
     $post->video_output = wpex_get_post_video_html($post->video);
     $post->excerpt = '';
     // Post Excerpt
     if ('true' == $excerpt || 'true' == $thumb_lightbox_caption) {
         $post->excerpt = wpex_get_excerpt(array('length' => intval($excerpt_length)));
     }
     // Does entry have details?
     if ('true' == $title || 'true' == $show_categories || 'true' == $excerpt && $post->excerpt || 'true' == $read_more) {
         $entry_has_details = true;
     } else {
         $entry_has_details = false;
     }
     // Add to the counter var
     $count++;
     // Add classes to the entries
     $entry_classes = array('portfolio-entry');
Пример #8
0
// Get featured image
$thumbnail = wpex_get_post_thumbnail(array('size' => 'blog_related'));
// Add classes
$classes = array('related-post', 'clr', 'nr-col');
$classes[] = wpex_grid_class($wpex_columns);
$classes[] = 'col-' . $wpex_count;
?>

<article <?php 
post_class($classes);
?>
>

	<?php 
// Display post video
if ($show_embeds && 'video' == $format && ($video = wpex_get_post_video_html())) {
    ?>

		<div class="related-post-video">
			<?php 
    echo $video;
    ?>
		</div><!-- .related-post-video -->

	<?php 
    // Display post audio
} elseif ($show_embeds && 'audio' == $format && ($audio = wpex_get_post_audio_html())) {
    ?>

		<div class="related-post-video">
			<?php