/** * vimeo_video_id * * Pega a url do vimeo e retorna o ID do video * * * @param $string * @return $string */ function vimeo_video_id($url) { if (is_vimeo($url)) { $pattern = '/\\/\\/(www\\.)?vimeo.com\\/(\\d+)($|\\/)/'; preg_match($pattern, $url, $matches); if (count($matches)) { return $matches[2]; } } return ''; }
<?php if (!is_search()) { ?> <?php $prefix = 'indonez_'; $video = get_post_meta($post->ID, $prefix . 'video_embed', true); ?> <?php if ($video) { ?> <div class="blog-media"> <?php if (is_youtube($video)) { echo '<div class="video-container-post"><a href="' . $video . '" rel="youtube"></a></div>'; } elseif (is_vimeo($video)) { echo '<div class="video-container-post"><a href="' . $video . '" rel="vimeo"></a></div>'; } elseif (is_quicktime($video)) { echo '<div class="video-container-post"><a href="' . $video . '" rel="quicktime"></a></div>'; } elseif (is_flash($video)) { echo '<div class="video-container-post"><a href="' . $video . '" rel="flash"></a></div>'; } ?> </div> <?php } ?> <?php } ?>
</div> <?php } else { if ($pf_link) { ?> <div class="pf-video-wrapper"> <?php if (is_youtube($pf_link)) { ?> <div class="portfolio_movie_container"><a href="<?php echo $pf_link; ?> " rel="youtube"></a></div> <?php } else { if (is_vimeo($pf_link)) { ?> <div class="portfolio_movie_container"><a href="<?php echo $pf_link; ?> " rel="vimeo"></a></div> <?php } else { if (is_quicktime($pf_link)) { ?> <div class="portfolio_movie_container"><a href="<?php echo $pf_link; ?> " rel="quicktime"></a></div> <?php } else {
function func_blog_post_col_indonez($showpost = "", $cat_id = "") { global $post; $out = ''; $out .= '<div class="masorny_col">'; query_posts('cat=' . $cat_id . '&posts_per_page=' . $showpost . '&orderby=date&order=DESC'); while (have_posts()) { the_post(); $out .= '<div class="four column mobile-two">'; $out .= '<div class="teaser">'; $out .= '<div class="teaser-preview-box">'; if (has_post_format('gallery')) { $args = array('order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'orderby' => 'menu_order', 'numberposts' => -1); $attachments = get_posts($args); $out .= '<div class="banner_blog_container">'; $out .= '<div class="banner-blog">'; $out .= '<ul>'; foreach ($attachments as $attachment) { $image_attributes = wp_get_attachment_image_src($attachment->ID, 'custom-medium-image'); $out .= '<li data-transition="slidehorizontal"><img src="' . $image_attributes[0] . '"></li>'; } $out .= '</ul>'; $out .= '<div class="tp-bannertimer tp-top"></div>'; $out .= '</div>'; $out .= '</div>'; } elseif (has_post_format('audio')) { $prefix = 'indonez_'; $audio = get_post_meta($post->ID, $prefix . 'audio_embed', true); if ($audio) { $out .= '<audio preload="auto" controls>'; $out .= '<source src="' . $audio . '">'; $out .= '</audio>'; } } elseif (has_post_format('video')) { $prefix = 'indonez_'; $video = get_post_meta($post->ID, $prefix . 'video_embed', true); if ($video) { if (is_youtube($video)) { $out .= '<div class="video-container-post"><a href="' . $video . '" rel="youtube"></a></div>'; } elseif (is_vimeo($video)) { $out .= '<div class="video-container-post"><a href="' . $video . '" rel="vimeo"></a></div>'; } elseif (is_quicktime($video)) { $out .= '<div class="video-container-post"><a href="' . $video . '" rel="quicktime"></a></div>'; } elseif (is_flash($video)) { $out .= '<div class="video-container-post"><a href="' . $video . '" rel="flash"></a></div>'; } else { } } } elseif (has_post_format('quote')) { $prefix = 'indonez_'; $quote_text = get_post_meta($post->ID, $prefix . 'quote_text', true); $quote_info_text = get_post_meta($post->ID, $prefix . 'quote_info_text', true); $out .= '<div class="note">'; $out .= '<blockquote><p>' . stripslashes($quote_text) . '</p><cite>' . $quote_info_text . '</cite></blockquote>'; $out .= '<div class="clear"></div>'; $out .= '</div>'; } elseif (has_post_format('link')) { $prefix = 'indonez_'; $link = get_post_meta($post->ID, $prefix . 'link_embed', true); if ($link) { $out .= '<div class="note">'; $out .= '<p class="lead">'; $out .= '<a href="' . $link . '" title="' . $link . '" target="_blank">' . $link . '</a>'; $out .= '</p>'; $out .= '</div>'; } } else { if (has_post_thumbnail()) { $out .= get_the_post_thumbnail('custom-medium-image', array('class' => 'max-image')); } } $out .= '</div>'; //end teaser-preview-box $out .= '<h6><a href="' . get_permalink() . '">' . get_the_title() . '</a></h6>'; $out .= '<h6 class="subheader">' . get_the_time('M d, Y', $post->ID) . '</h6>'; if (!has_post_format('quote')) { $excerpt = get_the_excerpt(); $out .= '<p>' . indonez_excerpt_limit_char($excerpt, 50, '...') . '</p>'; } $out .= '<a href="' . get_permalink() . '" class="more-link"><span class="button small rdm">' . __('Read More', 'indonez') . '</span></a>'; $out .= '</div>'; $out .= '</div>'; } wp_reset_query(); $out .= '</div>'; return $out; }