Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div class="single_portfolio_container">
- <?php
- $repeater = get_field("slider");
- if($repeater):
- ?>
- <div class="portfoli_galery_container">
- <nav class="portfolio-navigation">
- <a href="#" class="next"><i class="fa fa-angle-right"></i></a>
- <a href="#" class="prev"><i class="fa fa-angle-left"></i></a>
- </nav>
- <ul>
- <?php
- if($repeater):
- foreach($repeater as $r):
- ?>
- <li class="<?php echo $r["fit_to_screen"] ? "img_fit" : ""; ?>">
- <?php
- if($r["acf_fc_layout"] == "image"):
- $html = "<img data-fit='".$r["fit_to_screen"]."' src='".$r["image"]["url"]."' alt='".$r["image"]["alt"]."'/>";
- echo apply_filters( 'post_thumbnail_html', $html, $post->ID , $r["image"]["id"], "large" , array("alt"=>$r["image"]["alt"]) );
- else:
- echo getVideoEmbed($r["video_url"]);
- endif;
- ?>
- </li>
- <?php
- endforeach;
- endif;
- ?>
- </ul>
- </div> <!-- portfoli_galery_container :END -->
- <br style="clear: both"/>
- <?php endif; ?>
- <div class="portfolio_info">
- <h1><?php the_title(); ?></h1>
- <?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="port_category_container">
- <i class="fa fa-folder"></i> <?php echo $terms_html_array;?>
- </div>
- <?php endif; ?>
- <?php
- global $post;
- setup_postdata($post);
- the_content();
- ?>
- <?php if(get_field("button_text") && get_field("button_url")): ?>
- <div class="view_project_grid"><a target="_blank" class="view_project" href="<?php the_field("button_url"); ?>"><?php the_field("button_text"); ?></a></div>
- <?php endif; ?>
- </div> <!-- portfolio_info :END -->
- <div class="portfolio_social_sharing">
- <i class="fa fa-facebook"></i><a class="facebook_share" href="<?php the_permalink(); ?>"><?php _e("Share","um_lang"); ?></a>
- <i class="fa fa-twitter"><a class="twitter_share" href="<?php the_permalink(); ?>"></i><?php _e("Tweet","um_lang"); ?></a>
- <i class="fa fa-linkedin"><a class="linkedin_share" href="<?php the_permalink(); ?>"></i><?php _e("Share","um_lang"); ?></a>
- <?php if(get_field("pinterest_image")): ?>
- <i class="fa fa-pinterest"><a data-image="<?php the_field("pinterest_image"); ?>" class="pinteres_share" href="<?php the_permalink(); ?>"></i><?php _e("Pin","um_lang"); ?></a>
- <?php endif; ?>
- </div> <!-- portfolio_social_sharing :END -->
- </div>
- </div> <!-- single_portfolio_container :END -->
- <script type="text/javascript">
- jQuery(document).ready(function($){
- $(".single_portfolio_container").waitForImages(function(){
- $(".portfoli_galery_container").css("height" , $(window).height() * 0.8 + "px");
- /*Center Images First*/
- $(window).resize(function(){
- $(".portfoli_galery_container").css("height" , $(window).height() * 0.8 + "px");
- var visible_li = $(".portfoli_galery_container li:visible");
- $(".portfoli_galery_container li").show();
- center_image();
- $(".portfoli_galery_container li").hide();
- visible_li.show();
- });
- center_image();
- function center_image(){
- jQuery('.portfoli_galery_container li').find('img').each(function(){
- var this_img = jQuery(this);
- /*If image is portrait make it look better*/
- if(this_img.width() > this_img.height() && this_img.data("fit")){
- this_img.css("height","auto");
- this_img.css("width","100%");
- }
- /*If image is portrait make it look better*/
- var parent_width = parseInt(this_img.parent().width() / 2);
- var this_img_width = parseInt(this_img.width() / 2);
- var parent_height = parseInt(this_img.parent().height() / 2);
- var this_img_height = parseInt(this_img.height() / 2);
- this_img.css("margin-left",(parent_width - this_img_width) + "px");
- this_img.css("margin-top",(parent_height - this_img_height) + "px");
- });
- }
- /*Center Images First*/
- $(".portfoli_galery_container li").hide();
- $(".portfoli_galery_container li:eq(0)").show();
- /*Navigate Through Slider*/
- $("a.next").click(function(e){
- e.preventDefault();
- var cur_slide = $(".portfoli_galery_container li:visible");
- var next_slide = cur_slide.next();
- if(!next_slide.length){
- next_slide = $(".portfoli_galery_container li:eq(0)");
- }
- cur_slide.stop(true,true).fadeOut("fast",function(){
- next_slide.stop(true,true).fadeIn("fast");
- });
- playPuaseVideo(next_slide);
- });
- $("a.prev").click(function(e){
- e.preventDefault();
- var cur_slide = $(".portfoli_galery_container li:visible");
- var next_slide = cur_slide.prev();
- if(!next_slide.length){
- next_slide = $(".portfoli_galery_container li:last");
- }
- cur_slide.stop(true,true).fadeOut("fast",function(){
- next_slide.stop(true,true).fadeIn("fast");
- });
- playPuaseVideo(next_slide);
- });
- /*Navigate Through Slider*/
- $(".portfoli_galery_container ul li:not(.img_fit)").imgLiquid({
- fill : false
- });
- });
- });
- </script>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement