Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="project_info" class="project_info_video">
- <a id="project_info_icon<?php echo get_field("menu_position","options") == "Top" ? "_down" : ""; ?>" class="project_info_js" href="javascript:"><i class="icon-reorder"></i></a>
- <div class="pr_info_holder <?php echo get_field("menu_position","options") == "Top" ? "pr_info_holder_menu_top" : ""; ?>">
- <div>
- <h4><?php the_title(); ?></h4>
- <div class="c_nav">
- <?php
- $terms = wp_get_post_terms( $post->ID,"portfolio_category" );
- $terms_html_array = array();
- $terms_id_array = array();
- $term_classes = "";
- foreach($terms as $t){
- $term_name = $t->name;
- $term_link = get_term_link($t->slug,$t->taxonomy);
- array_push($terms_html_array,"<a href='{$term_link}'>{$term_name}</a>");
- array_push($terms_id_array,$t->slug);
- $term_classes .= "um_".$t->slug." ";
- }
- $terms_html_array = implode(", ",$terms_html_array);
- if($terms_html_array):
- ?>
- <div class="categories">
- <i class="icon-folder-close"></i><?php echo $terms_html_array;?>
- </div>
- <?php
- endif;
- if($GLOBALS["um_likes"]):
- $coockie_offset = 'um_liked_'.$post->ID;
- $liked = isset($_COOKIE[$coockie_offset]) && $_COOKIE[$coockie_offset] ? "liked" : "";
- ?>
- <a class="like <?php echo $liked; ?>" href="#" data-postid="<?php echo $post->ID; ?>">
- <i class="icon-heart"></i><p><?php echo get_likes(); ?></p>
- </a>
- <?php endif; ?>
- </div>
- <?php
- global $post;
- setup_postdata($post);
- the_content();
- if(get_field("link_button_text") && get_field("link_button_url")):
- ?>
- <a class="visit_site" href="<?php the_field("link_button_url"); ?>">
- <?php the_field("link_button_text"); ?>
- </a>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <div class="video_fullscreen">
- <div class="video_overlay" style="opacity:0.5;background: #000"></div>
- <?php
- $url = get_field("video_url");
- $youtube = "";
- $vimeo = "";
- if($url):
- preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $url, $youtube);
- sscanf(parse_url($url, PHP_URL_PATH), '/%d', $vimeo);
- if($vimeo):
- ?>
- <iframe class="vimeo" src="http://player.vimeo.com/video/<?php echo $vimeo; ?>?api=1" width="100%" height="100%" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
- <?php else: ?>
- <div id="ov_vid" data-vid="<?php echo $youtube[0]; ?>"></div>
- <?php endif; ?>
- <?php else: ?>
- <video autoplay="autoplay" id="player" loop="loop" controls="controls">
- <?php if(get_field("video_mp4")): ?>
- <source type="video/mp4" src="<?php the_field("video_mp4"); ?>" />
- <?php elseif(get_field("video_mp4")): ?>
- <source type="video/mp4" src="<?php the_field("video_mp4_url"); ?>" />
- <?php endif; ?>
- <?php if(get_field("video_vp8")): ?>
- <source type="video/webm" src="<?php the_field("video_vp8"); ?>" />
- <?php elseif(get_field("video_mp4")): ?>
- <source type="video/webm" src="<?php the_field("video_vp8_url"); ?>" />
- <?php endif; ?>
- <?php if(get_field("video_ogg")): ?>
- <source type="video/ogg" src="<?php the_field("video_ogg"); ?>" />
- <?php elseif(get_field("video_mp4")): ?>
- <source type="video/ogg" src="<?php the_field("video_ogg_url"); ?>" />
- <?php endif; ?>
- </video>
- <?php endif; ?>
- </div>
- <div id="slides" style="display: none">
- <ul class="slides-container">
- <li>
- <?php if(get_field("video_poster")): ?>
- <img src="<?php the_field("video_poster"); ?>"/>
- <?php endif; ?>
- <div class="img_overlay" style="opacity: 0.1;background: #000000"></div>
- <div class="capture">
- <?php if(get_field("label")): ?>
- <p class="fadeInDown animated">
- <?php the_field("label"); ?>
- </p>
- <?php endif;?>
- <br style="clear: both">
- <?php if(get_field("video_url")): ?>
- <a class="fadeInDown animated" href="<?php the_field("video_url"); ?>"><?php _e("Watch video","um_lang"); ?></a>
- <?php endif; ?>
- </div>
- </li>
- <li>
- <?php if(get_field("video_poster")): ?>
- <img src="<?php the_field("video_poster"); ?>"/>
- <?php endif; ?>
- <div class="img_overlay" style="opacity: 0.1;background: #000000"></div>
- <div class="capture">
- <?php if(get_field("label")): ?>
- <p class="fadeInDown animated">
- <?php the_field("label"); ?>
- </p>
- <?php endif;?>
- <br style="clear: both">
- <?php if(get_field("button_text") && get_field("button_url")): ?>
- <a class="fadeInDown animated" href="<?php the_field("button_url"); ?>"><?php the_field("button_text"); ?></a>
- <?php endif; ?>
- </div>
- </li>
- </ul>
- </div>
- <?php
- $projects_page = "";
- if(get_field("projects_page","options")){
- $projects_page = get_field("projects_page","options");
- }else{
- $the_query = new WP_Query( array(
- "post_type" => "page",
- "meta_query" => array(
- array(
- "key" => "_wp_page_template",
- "value" => array("template-projects.php","template-projects-grid.php")
- )
- )
- ) );
- if($the_query->have_posts()){
- $the_query->the_post();
- $projects_page = get_permalink($post->ID);
- }
- wp_reset_postdata();
- }
- ?>
- <div class="<?php echo get_field("menu_position","options") == "Top" ? "project_vid_back_bottom" : "project_vid_back_top"; ?>">
- <a href="<?php echo $projects_page; ?>" class="close_btn" onclick="<?php if(!$projects_page): ?>history.go(-1);return false;<?php endif; ?>" ><i class="icon-th"></i></a>
- </div>
- <script type="text/javascript">
- var onMessageReceived,onYouTubeIframeAPIReady;
- jQuery(document).ready(function($){
- $("a.close_btn").click(function(e){
- if(window.history.length > 1){
- e.preventDefault();
- e.stopPropagation();
- history.go(-1);
- }
- });
- var touch = Modernizr.touch;
- if(!touch){
- <?php if($vimeo): ?>
- /*Vimeo API*/
- var f = jQuery('iframe.vimeo');
- url = f.attr('src').split('?')[0];
- onMessageReceived = function(e) {
- var data = JSON.parse(e.data);
- switch (data.event) {
- case 'ready':
- onReady();
- break;
- }
- }
- function onReady() {
- post("play","");
- post("setLoop","1");
- post("setVolume",parseFloat("<?php the_field("video_volume"); ?>") * 10);
- }
- if (window.addEventListener) {
- window.addEventListener('message', onMessageReceived, false);
- }
- else{
- window.attachEvent('onmessage', onMessageReceived, false);
- }
- function post(action, value) {
- var data = { method: action };
- if (value) {
- data.value = value;
- }
- f[0].contentWindow.postMessage(JSON.stringify(data), url);
- }
- /*Vimeo API*/
- <?php
- endif;
- if($youtube):
- ?>
- /*Youtube API*/
- var player;
- onYouTubeIframeAPIReady = function() {
- var vid = jQuery("#ov_vid").data("vid");
- try{
- if(typeof YT === 'object'){
- player = new YT.Player('ov_vid', {
- height: '100%',
- width: '100%',
- videoId: vid,
- playerVars: { 'h1' : 1 , 'modestbranding' : 0, 'disablekb' : 1, 'autoplay': 1, 'controls': 0, 'playlist': vid, 'loop': 1, 'showinfo': 0, 'wmode': 'transparent' , 'iv_load_policy' : '3'},
- events: {
- 'onReady': onPlayerReady
- }
- });
- }
- }catch(err){
- }
- }
- //onYouTubeIframeAPIReady();
- $('.inner_content').waitForImages(function(){
- onYouTubeIframeAPIReady();
- });
- function onPlayerReady(event) {
- event.target.setVolume(parseFloat("<?php the_field("video_volume"); ?>") * 10);
- }
- /*Youtube API*/
- <?php endif; ?>
- }
- $(".loader").stop(true,true).show();
- var project_info_width = $("#project_info").width();
- $("#project_info").css("left",-(project_info_width) + 'px');
- $('.accordion li:first-child').find('a').addClass('active').find('i').removeClass('icon-plus-sign').addClass('icon-minus-sign');
- $('.accordion li:first-child').find('.section_content').show();
- $('.tabs .tab_buttons > li:first-child').find('a').addClass('active');
- $('.tabs .tab_content li:first-child').show();
- $('.pr_info_holder').niceScroll();
- $('#slides').waitForImages(function(){
- hide_loader();
- });
- if(touch){
- jQuery(".video_fullscreen").next().hide();
- jQuery(".video_fullscreen").hide();
- jQuery("#slides").show();
- jQuery("#slides").superslides({
- pagination : false
- });
- }else{
- jQuery('video').mediaelementplayer({
- pluginPath : template_directory+"/assets/mediaelement/",
- startVolume : parseFloat("<?php the_field("video_volume"); ?>"),
- loop: true,
- features : ['volume'],
- enableAutosize : false,
- videoWidth : "100%",
- videoHeight : "100%"
- });
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement