Exemple #1
0
    /**
     * Outputs the HTML for this widget.
     *
     * @param array An array of standard parameters for widgets in this theme
     * @param array An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        global $post;
        extract($args, EXTR_SKIP);
        wp_enqueue_script('frogaloop', get_template_directory_uri() . '/js/frogaloop.js', array(), wpzoom::$themeVersion, true);
        wp_enqueue_script('youtube-api', 'http://www.youtube.com/player_api', array(), wpzoom::$themeVersion, true);
        $title = apply_filters('widget_title', $instance['title']);
        if (!isset($instance['number'])) {
            $instance['number'] = '5';
        }
        if (!($number = absint($instance['number']))) {
            $number = 5;
        }
        $videos_recent_args = array('order' => 'DESC', 'posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts'), 'tax_query' => array(array('taxonomy' => 'post_format', 'terms' => array('post-format-video'), 'field' => 'slug', 'operator' => 'IN')));
        $videos_recent = new WP_Query();
        $videos_recent->query($videos_recent_args);
        // If there aren't any videos at all, bail.
        if (!$videos_recent->have_posts()) {
            return false;
        }
        echo $before_widget;
        /* Title of widget (before and after defined by themes). */
        if ($title) {
            echo $before_title . $title;
        }
        ?>
            <a href="<?php 
        echo get_post_format_link('video');
        ?>
" class="see-all"><?php 
        _e('See All &raquo;', 'wpzoom');
        ?>
</a>

            <?php 
        echo $after_title;
        ?>
 
        
        <div id="recent-videos" class="flexslider">
        
            <?php 
        if ($videos_recent->have_posts()) {
            ?>
  
                     
                    <ul class="slides">
            
                        <?php 
            while ($videos_recent->have_posts()) {
                $videos_recent->the_post();
                $videocode = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);
                ?>
                            <li><?php 
                if (strlen($videocode) > 1) {
                    echo '<div class="post-video">' . embed_fix($videocode, 300, 170) . '</div>';
                } else {
                    get_the_image(array('size' => 'video-widget', 'width' => 300, 'height' => 170, 'before' => '<div class="post-thumb">', 'after' => '</div>'));
                }
                ?>

                                <h4><a href="<?php 
                the_permalink();
                ?>
" rel="bookmark" title="<?php 
                printf(__('Permanent Link to %s', 'wpzoom'), get_the_title());
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
 
                            </li>
                        <?php 
            }
            ?>
                
                    </ul>
                        
            
            <?php 
        }
        ?>
 
            
        </div>

<?php 
        echo $after_widget;
    }
Exemple #2
0
				<?php 
    rewind_posts();
    while ($loop->have_posts()) {
        $loop->the_post();
        $video = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);
        ?>
<li class="post-<?php 
        echo $post->ID;
        ?>
">
 					 
 						<?php 
        if (strlen($video) > 1) {
            // Embedding video
            echo '<div class="video_cover">' . embed_fix($video, 480, 270) . '</div>';
            // add wmode=transparent to iframe/embed
        } else {
            get_the_image(array('size' => 'featured', 'before' => '<div class="cover">', 'after' => '</div>', 'width' => 480, 'height' => 330));
        }
        ?>
 					  
						<div class="slide_content">
 
							<h2><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title_attribute();
        ?>
"><?php 
Exemple #3
0
    $i++;
    $video = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);
    ?>
		
		<div id="post-<?php 
    the_ID();
    ?>
" class="recent-post" >

 		 	<?php 
    if (option::get('index_thumb') == 'on') {
        if ($video) {
            ?>
	 
					<div class="video_cover"><?php 
            echo embed_fix($video, 680, 383);
            ?>
</div>

				<?php 
        } else {
            get_the_image(array('size' => 'loop', 'width' => option::get('thumb_width'), 'height' => option::get('thumb_height'), 'before' => '<div class="post-thumb">', 'after' => '</div>'));
        }
    }
    ?>
	 		 
			<div class="post-content">	
				
				<?php 
    if (option::get('display_category') == 'on') {
        ?>
Exemple #4
0
    $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'featured');
    ?>

			<div>

				<?php 
    if ($video) {
        ?>

					<div class="video_slide" style="background-image:url(<?php 
        echo $large_image_url[0];
        ?>
)"></div>

					<div class="video_cover" data-embed="<?php 
        echo esc_attr(embed_fix($video, 800, 450));
        ?>
"></div>

				<?php 
    } else {
        ?>

					<div class="slide_content_wrap">
						<div class="slide_content">

							<span>
								<h3><a href="<?php 
        the_permalink();
        ?>
" title="<?php