$date_label = yiw_translate(get_post_meta(get_the_ID(), '_portfolio_date_label', true) ? get_post_meta(get_the_ID(), '_portfolio_date_label', true) : __('Date', 'yiw')); $date = yiw_translate(get_post_meta(get_the_ID(), '_portfolio_date', true)); ?> <div id="post-<?php the_ID(); ?> " <?php post_class('hentry-post group portfolio-post internal-post'); ?> > <?php if ($video) { list($type, $id) = explode(':', yiw_video_type_by_url($video)); ?> <div class="post_video <?php echo $type; ?> "> <?php echo do_shortcode("[{$type} video_id=\"{$id}\" width=\"100%\" height=\"100%\"]"); ?> </div> <?php } else { ?>
/** * Retrieve and print the type and content of the slide * * @param array $slide The slide array, from the Theme Options * @param string $before The string before the image * @param string $after The string after the image * @param bool $container If put the image or video into a container * @return null * * @since 1.0 */ function yiw_featured_content($slide, $args = array()) { global $link; $default = array('before' => '', 'after' => '', 'container' => true, 'video_width' => 425, 'video_height' => 356); $args = wp_parse_args($args, $default); extract($args, EXTR_SKIP); switch ($slide['content_type']) { case 'image': ?> <?php if ($link) { ?> <a href="<?php echo $link_url; ?> "><?php } ?> <?php if ($container) { ?> <div class="featured-image"><?php } echo $before; ?> <img src="<?php echo $slide['image_url']; ?> " alt="<?php echo $slide['slide_title']; ?> " /><?php echo $after; if ($container) { ?> </div><?php } ?> <?php if ($link) { ?> </a><?php } ?> <?php break; case 'video': list($type, $id) = explode(':', yiw_video_type_by_url($slide['url_video'])); switch ($type) { case 'youtube': ?> <div class="video-container"> <div id="video-youtube-<?php echo $id; ?> "></div> </div> <script type="text/javascript"> swfobject.embedSWF("http://www.youtube.com/e/<?php echo $id; ?> ", "video-youtube-<?php echo $id; ?> ", "<?php echo $video_width; ?> ", "<?php echo $video_height; ?> ", "8", null, null, { allowScriptAccess: "always", wmode: "transparent" }, { id: "video-youtube-<?php echo $id; ?> -player" } ); </script> <?php break; case 'vimeo': ?> <div class="video-container"> <div id="video-youtube-<?php echo $id; ?> "> <object width="<?php echo $video_width; ?> " height="<?php echo $video_height; ?> "> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="wmode" value="transparent" /> <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=<?php echo $id; ?> &server=vimeo.com&color=00adef&fullscreen=1" /> <embed src="http://vimeo.com/moogaloop.swf?clip_id=<?php echo $id; ?> &server=vimeo.com&color=00adef&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="<?php echo $video_width; ?> " height="<?php echo $video_height; ?> "></embed> </object> </div> </div> <?php break; } break; } }
/** * Retrieve and print the type and content of the slide * * @return null * * @since 1.0 */ function featured_content($args = array()) { $default = array('container' => true, 'before' => '', 'after' => '', 'video_width' => 425, 'video_height' => 356, 'echo' => true); $args = wp_parse_args($args, $default); extract($args, EXTR_SKIP); $slide = $this->current_slide; $link = $this->there_is_link; $link_url = $this->url_slide; $output = $attr = ''; $output .= $before; switch ($slide['content_type']) { case 'image': if ($container) { $output .= '<div class="featured-image">'; } if (function_exists('getimagesize')) { $uploads = wp_upload_dir(); $image_url = $this->get('image_url'); $slide['image_path'] = str_replace($uploads['baseurl'], $uploads['basedir'], $image_url); if (file_exists($slide['image_path'])) { list($width, $height, $type, $attr) = getimagesize($slide['image_path']); } } if (isset($slide['slide_title'])) { $alt = $slide['slide_title']; } else { $alt = ''; } $output .= $this->a_before . '<img src="' . $image_url . '" ' . $attr . ' alt="' . strip_tags($alt) . '" />' . $this->a_after; if ($container) { $output .= '</div>'; } break; case 'video': list($type, $id) = explode(':', yiw_video_type_by_url($slide['url_video'])); switch ($type) { case 'youtube': $output .= '<div class="video-container">' . do_shortcode("[youtube width=\"{$video_width}\" height=\"{$video_height}\" video_id=\"{$id}\"]") . '</div>'; // $output .= ' // <div class="video-container"> // <div id="video-youtube-' . $id . '"></div> // </div> // <script type="text/javascript"> // // swfobject.embedSWF("http://www.youtube.com/e/' . $id . '", // "video-youtube-' . $id . '", "' . $video_width . '", "' . $video_height . '", "8", null, null, { allowScriptAccess: "always", wmode: "transparent" }, { id: "video-youtube-' . $id . '-player" } ); // // </script>'; break; case 'vimeo': $output .= '<div class="video-container">' . do_shortcode("[vimeo width=\"{$video_width}\" height=\"{$video_height}\" video_id=\"{$id}\"]") . '</div>'; // $output .= ' // <div class="video-container"> // <div id="video-vimeo-' . $id . '"></div> // </div> // <script type="text/javascript"> // // swfobject.embedSWF("http://vimeo.com/moogaloop.swf?clip_id=' . $id . '&server=vimeo.com&color=00adef&fullscreen=1", // "video-vimeo-' . $id . '", "' . $video_width . '", "' . $video_height . '", "8", null, null, { allowScriptAccess: "always", wmode: "transparent" }, { id: "video-youtube-' . $id . '-player" } ); // // </script>'; break; } break; } $output .= $after . "\n"; if ($echo) { echo $output; } else { return $output; } }