" data-original="<?php 
                echo $member['ut_member_pic'];
                ?>
">
                                                                    
                                 </figure>
                                 
                                 <?php 
                if (!empty($member['ut_member_pic_alt'])) {
                    ?>
                                        
                                         <?php 
                    if ($avatar_style == 'ut-circle') {
                        $member['ut_member_pic_alt'] = ut_resize($member['ut_member_pic_alt'], '560', '640', true, true, true);
                    } else {
                        $member['ut_member_pic_alt'] = ut_resize($member['ut_member_pic_alt'], '560', '640', true, true, true);
                    }
                    ?>
                                    
                                    <figure class="member-photo-style-4-hover">
                                        
                                        <img src="<?php 
                    echo $member['ut_member_pic_alt'];
                    ?>
" alt="<?php 
                    echo $member['ut_member_name'];
                    ?>
">
                                    
                                    </figure>
                                    
Exemple #2
0
    ?>
                        
                        <ul class="ut-tablet">
                            
                        <?php 
    $counter = 1;
    foreach ($ut_tabs as $tab) {
        ?>
                                    
                            <li class="<?php 
        echo $counter == 1 ? 'show' : '';
        ?>
">
                                
                                <?php 
        $tab_image = ut_resize(ut_translate_meta($tab['image']), '800', '800', true, true, true);
        ?>
                                
                                <img src="<?php 
        echo $tab_image;
        ?>
" alt="<?php 
        echo $tab['title'];
        ?>
">
                                
                                <div class="ut-tablet-overlay">
                                    <div class="ut-tablet-overlay-content">
                                    <?php 
        if (!empty($tab['title'])) {
            ?>
 function ut_single_quote($atts, $content = null)
 {
     extract(shortcode_atts(array('author' => '', 'company' => '', 'avatar' => '', 'title' => '', 'width' => '', 'date' => '', 'rating' => '', 'last' => 'false', 'margin_bottom' => '', 'class' => '', 'effect' => ''), $atts));
     /* width */
     $grid = array('third' => 'ut-one-third', 'fourth' => 'ut-one-fourth', 'half' => 'ut-one-half');
     $last = $last == 'true' ? 'ut-column-last' : '';
     /* ratings */
     $ratings = array('one' => '<li class="ut-rated"><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li>', 'two' => '<li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li>', 'three' => '<li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li>', 'four' => '<li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li>', 'five' => '<li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li><li class="ut-rated"><i class="fa fa-star"></i></li>');
     /* fallback */
     $gridwidth = !empty($grid[$width]) ? $grid[$width] : '';
     /* animation effect */
     $dataeffect = $animated = NULL;
     if (!empty($effect)) {
         $dataeffect = 'data-effect="' . $effect . '"';
         $animated = 'ut-animate-element animated';
     }
     if (!empty($margin_bottom)) {
         $margin_bottom = str_replace('px', '', $margin_bottom);
         $margin_bottom = 'style="margin-bottom:' . $margin_bottom . 'px;"';
     }
     $testimonial = '<div class="' . $gridwidth . ' ' . $class . ' ' . $last . '" ' . $margin_bottom . '>';
     if (!empty($avatar)) {
         $avatar = ut_resize($avatar, '80', '80', true, true, true);
         $testimonial .= '<figure ' . $dataeffect . ' class="ut-st-avatar ' . $animated . '"><img alt="' . $author . '" src="' . $avatar . '" /></figure>';
     }
     $testimonial .= '<div class="ut-st">';
     if (!empty($title) || !empty($date)) {
         $testimonial .= '<header class="ut-st-header">';
         if (!empty($title)) {
             $testimonial .= '<h3 class="ut-st-title">' . $title . '</h3>';
         }
         if (!empty($date)) {
             $testimonial .= '<span class="ut-st-date">' . $date . '</span>';
         }
         $testimonial .= '</header>';
     }
     $testimonial .= '<p>' . do_shortcode($content) . '</p>';
     if (!empty($rating) && isset($ratings[$rating])) {
         $testimonial .= '<div class="ut-st-rating"><ul>' . $ratings[$rating] . '</ul></div>';
     }
     if (!empty($author)) {
         $testimonial .= '<strong class="ut-st-name">' . $author . '</strong>';
     }
     if (!empty($company)) {
         $testimonial .= '<span class="ut-st-subtitle">' . $company . '</span>';
     }
     $testimonial .= '</div>';
     $testimonial .= '</div>';
     return $testimonial;
 }
 function ut_quote($atts, $content)
 {
     extract(shortcode_atts(array('author' => '', 'avatar' => ''), $atts));
     if (!empty($avatar)) {
         $avatar = ut_resize($avatar, '200', '200', true, true, true);
     }
     $quote = '<li><img alt="' . $author . '" class="ut-quote-avatar" src="' . $avatar . '" /><span class="ut-quote-comment">' . do_shortcode($content) . '</span><h3 class="ut-quote-name">' . $author . '</h3></li>';
     return $quote;
 }
 static function create_portfolio_gallery()
 {
     global $paged, $wp_query;
     /* pagination */
     if (empty($paged)) {
         if (!empty($_GET['paged'])) {
             $paged = $_GET['paged'];
         } elseif (!empty($wp->matched_query) && ($args = wp_parse_args($wp->matched_query))) {
             if (!empty($args['paged'])) {
                 $paged = $args['paged'];
             }
         }
         if (!empty($paged)) {
             $wp_query->set('paged', $paged);
         }
     }
     $temp = $wp_query;
     $wp_query = $term = null;
     /* settings */
     $portfolio_categories = get_post_meta(self::$token, 'ut_portfolio_categories');
     $term = '';
     /* global portfolio settings */
     $portfolio_settings = get_post_meta(self::$token, 'ut_portfolio_settings');
     $portfolio_settings = $portfolio_settings[0];
     /* gallery options */
     $gallery_options = get_post_meta(self::$token, 'ut_gallery_options');
     $gallery_options = $gallery_options[0];
     /* detail style */
     $detailstyle = !empty($portfolio_settings['detail_style']) ? $portfolio_settings['detail_style'] : 'slideup';
     /* columnset */
     $columnset = !empty($gallery_options['columns']) ? $gallery_options['columns'] : 4;
     $gutter = !empty($gallery_options['gutter']) ? 'gutter' : '';
     /* image style */
     $image_style_class = $portfolio_settings['image_style'];
     /* variables for last row item */
     switch ($columnset) {
         case 2:
             $z = 0;
             $counter = 1;
             break;
         case 3:
             $z = 4;
             $counter = 2;
             break;
         case 4:
             $z = 5;
             $counter = 3;
             break;
     }
     /* fallback if no meta has been set */
     $portfolio_per_page = !empty($portfolio_settings['posts_per_page']) ? $portfolio_settings['posts_per_page'] : 4;
     $portfolio_categories = !empty($portfolio_categories) ? $portfolio_categories : array();
     /* portfolio query terms */
     $portfolio_terms = array();
     if (is_array($portfolio_categories[0]) && !empty($portfolio_categories[0])) {
         foreach ($portfolio_categories[0] as $key => $value) {
             array_push($portfolio_terms, $key);
         }
         $portfolio_terms_query = $portfolio_terms;
     }
     /* only change term if browser is browsing this portfolio */
     if (!empty($_GET['portfolioID']) && $_GET['portfolioID'] == self::$token) {
         if ($gallery_options['filter_type'] == 'static' && !empty($_GET['termID'])) {
             /* sanitize term */
             $term = absint($_GET['termID']);
             /* reset terms */
             $portfolio_terms_query = array();
             array_push($portfolio_terms_query, $term);
         }
     }
     /* user is not browsing this portfolio , so we reset the pagination */
     if (!empty($_GET['portfolioID']) && $_GET['portfolioID'] != self::$token) {
         $paged = 0;
     }
     /* query args */
     $portfolio_args = array('post_type' => 'portfolio', 'posts_per_page' => $portfolio_per_page, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'terms' => $portfolio_terms_query, 'field' => 'term_id')));
     /* start query */
     $portfolio_query = $wp_query = new WP_Query($portfolio_args);
     /* portfolio filter */
     if (!empty($gallery_options['filter'])) {
         $filter = '<div class="ut-portfolio-menu-wrap"><ul id="ut-portfolio-menu-' . self::$token . '" class="ut-portfolio-menu ' . (!empty($gallery_options['filter_style']) ? $gallery_options['filter_style'] : 'style_one') . '">';
         /* reset button */
         $reset = !empty($gallery_options['reset_text']) ? $gallery_options['reset_text'] : __('All', 'ut_portfolio_lang');
         if ($gallery_options['filter_type'] == 'static') {
             $selected = empty($term) ? 'class="selected"' : '';
             $filter .= '<li><a href="?portfolioID=' . self::$token . '#ut-portfolio-items-' . self::$token . '-anchor" data-filter="*" ' . $selected . '>' . $reset . '</a></li>';
         } else {
             $filter .= '<li><a href="#" data-filter="*" class="selected">' . $reset . '</a></li>';
         }
         /* get taxonomies */
         $taxonomies = get_terms('portfolio-category');
         $taxonomiesarray = json_decode(json_encode($taxonomies), true);
         if (is_array($portfolio_terms) && is_array($taxonomies)) {
             foreach ($portfolio_terms as $single_term) {
                 $key = self::search_tax_key($single_term, $taxonomiesarray);
                 if ($gallery_options['filter_type'] == 'static' && isset($key)) {
                     $selected = $taxonomies[$key]->term_id == $term ? 'class="selected"' : '';
                     $filter .= '<li><a ' . $selected . ' href="?termID=' . $taxonomies[$key]->term_id . '&amp;portfolioID=' . self::$token . '#ut-portfolio-items-' . self::$token . '-anchor" data-filter=".' . $taxonomies[$key]->slug . '-filt">' . $taxonomies[$key]->name . '</a></li>';
                 } else {
                     if (isset($taxonomies[$key]->slug)) {
                         $filter .= '<li><a href="#" data-filter=".' . $taxonomies[$key]->slug . '-filt">' . $taxonomies[$key]->name . '</a></li>';
                     }
                 }
             }
         }
         $filter .= '</ul></div>';
     }
     /* needed javascript */
     $gallery = self::generate_gallery_script($gallery_options, $counter);
     /* create hidden gallery */
     if ($detailstyle == 'slideup') {
         $gallery .= self::create_hidden_popup_portfolio($portfolio_args, $portfolio_settings['image_style']);
     }
     /* output portfolio wrap */
     $gallery .= '<div id="ut-portfolio-wrap" class="ut-portfolio-wrap" data-textcolor="' . $portfolio_settings["text_color"] . '" data-opacity="' . $portfolio_settings["hover_opacity"] . '" data-hovercolor="' . ut_hex_to_rgb($portfolio_settings["hover_color"]) . '">';
     $gallery .= '<a class="ut-portfolio-offset-anchor" style="top:-120px;" id="ut-portfolio-items-' . self::$token . '-anchor"></a>';
     /* add filter */
     if (isset($gallery_options['filter'])) {
         $gallery .= $filter;
     }
     /* output portfolio container */
     $gallery .= '<div id="ut-portfolio-items-' . self::$token . '" class="ut-portfolio-item-container">';
     /* loop trough portfolio items */
     if ($portfolio_query->have_posts()) {
         while ($portfolio_query->have_posts()) {
             $portfolio_query->the_post();
             /* needed variables */
             $projecttype = '';
             $title = str_ireplace('"', '', trim(get_the_title()));
             $post_format = get_post_format();
             /* link settings */
             $ut_portfolio_link_type = get_post_meta($portfolio_query->post->ID, 'ut_portfolio_link_type', true);
             $external = false;
             $target = '_blank';
             /* theme meta boxes are storing strings */
             if (!is_array($ut_portfolio_link_type)) {
                 $temp_array = array();
                 $temp_array['target'] = $ut_portfolio_link_type;
                 $ut_portfolio_link_type = $temp_array;
                 $temp_array = null;
             }
             if (!empty($ut_portfolio_link_type['target']) && $ut_portfolio_link_type['target'] == 'external') {
                 /* get link user haas to set */
                 $external = get_post_meta($portfolio_query->post->ID, 'ut_external_link', true);
             } elseif (!empty($ut_portfolio_link_type['target']) && $ut_portfolio_link_type['target'] == 'internal') {
                 /* get permalink to single portfolio */
                 $external = get_permalink($portfolio_query->post->ID);
                 $target = '_self';
             }
             /* itemposition */
             $itemposition = '';
             if ($columnset != 3) {
                 if ($columnset == 2) {
                     $z % 2 == 0 ? $itemposition = '' : ($itemposition = 'last');
                 }
                 if ($columnset == 4) {
                     $z % 4 == 0 ? $itemposition = 'last' : ($itemposition = '');
                 }
             } else {
                 if ($z % 3 == 0) {
                     $itemposition = 'last';
                     $z = 3;
                 }
             }
             /* get all portfolio-categories for this item ( needed for filter ) */
             $portfolio_cats = wp_get_object_terms($portfolio_query->post->ID, 'portfolio-category');
             /* set filter attributes */
             if (is_array($portfolio_cats)) {
                 foreach ($portfolio_cats as $single_cat) {
                     $projecttype .= $single_cat->slug . "-filt ";
                 }
             }
             /* gallery style */
             $gallery_style = !empty($gallery_options['style']) ? $gallery_options['style'] : 'style_one';
             /* portfolio featured image */
             $fullsize = $thumbnail = $portfolio_detail_image = wp_get_attachment_url(get_post_thumbnail_id($portfolio_query->post->ID));
             $caption = get_post(get_post_thumbnail_id($portfolio_query->post->ID))->post_excerpt;
             /* hero type setting - new with 2.6 */
             $ut_page_hero_type = get_post_meta($portfolio_query->post->ID, 'ut_page_hero_type', true);
             $optionkey = 'ut_page_hero_image';
             if (!empty($ut_page_hero_type)) {
                 if ($ut_page_hero_type == 'image' || $ut_page_hero_type == 'animatedimage' || $ut_page_hero_type == 'splithero' || $ut_page_hero_type == 'custom' || $ut_page_hero_type == 'dynamic') {
                     $post_format = '';
                 }
                 if ($ut_page_hero_type == 'slider' || $ut_page_hero_type == 'transition' || $ut_page_hero_type == 'tabs') {
                     $post_format = 'gallery';
                 }
                 if ($ut_page_hero_type == 'video') {
                     $post_format = 'video';
                     $ut_page_video_source = get_post_meta($portfolio_query->post->ID, 'ut_page_video_source', true);
                 }
                 /* switch option key */
                 switch ($ut_page_hero_type) {
                     case 'animatedimage':
                         $optionkey = 'ut_page_hero_animated_image';
                         break;
                     default:
                         $optionkey = 'ut_page_hero_image';
                 }
             }
             /* end ut_page_hero_type */
             /* check if there is a detail image available */
             $portfolio_detail_image_data = get_post_meta($portfolio_query->post->ID, $optionkey, true);
             if (is_array($portfolio_detail_image_data) && !empty($portfolio_detail_image_data['background-image'])) {
                 $portfolio_detail_image = $portfolio_detail_image_data['background-image'];
             } elseif (!is_array($portfolio_detail_image_data) && !empty($portfolio_detail_image_data)) {
                 $portfolio_detail_image = $portfolio_detail_image_data;
             }
             /* cropping dimensions */
             $width = !empty($gallery_options['crop_size_x']) ? $gallery_options['crop_size_x'] : '600';
             $height = !empty($gallery_options['crop_size_y']) ? $gallery_options['crop_size_y'] : '400';
             $thumbnail = ut_resize($fullsize, $width, $height, true, true, true);
             /* style one images with title */
             if ($gallery_style == 'style_one') {
                 /* create single portfolio item */
                 $gallery .= '<article class="' . $projecttype . ' ' . $itemposition . ' ut-masonry ' . $gutter . ' portfolio-style-one">';
                 $gallery .= '<div class="ut-portfolio-item ut-hover">';
                 /* link markup for slideup details */
                 if ($detailstyle == 'slideup') {
                     /* has external link */
                     if (!empty($external)) {
                         $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                     } else {
                         $gallery .= '<a class="ut-portfolio-link ' . $image_style_class . '" rel="bookmark" title="' . $title . '" data-wrap="' . self::$token . '" data-post="' . $portfolio_query->post->ID . '" href="#ut-portfolio-details-wrap-' . self::$token . '">';
                     }
                 }
                 /* link markup for image popup */
                 if ($detailstyle == 'popup') {
                     $popuplink = NULL;
                     /* image post or audio post */
                     if (empty($post_format) || $post_format == 'audio') {
                         /* has external link */
                         if (!empty($external)) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= '<div class="ut-new-hide" id="ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '"><h4>' . $title . '</h4><p>' . $caption . '</p></div>';
                             }
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $portfolio_settings['image_style'] . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $portfolio_detail_image . '">';
                         }
                     }
                     /* video post */
                     if ($post_format == 'video') {
                         /* has external link */
                         if (!empty($external)) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             /* get the content */
                             if (!empty($ut_page_hero_type) && $ut_page_hero_type == 'video') {
                                 /* youtube video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'youtube') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video', true);
                                 }
                                 /* selfhosted video - not supported by prettyphoto */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'selfhosted') {
                                     $popuplink = $fullsize;
                                 }
                                 /* custom video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'custom') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video_custom', true);
                                 }
                                 /* content is still empty - let's assign the regular content */
                                 if (empty($content)) {
                                     $content = get_the_content();
                                 }
                             } else {
                                 $content = get_the_content();
                             }
                             /* try to catch video url */
                             $popuplink = !empty($popuplink) ? $popuplink : ut_get_portfolio_format_video_content($content);
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= '<div class="ut-new-hide" id="ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '"><h4>' . $title . '</h4><p>' . $caption . '</p></div>';
                             }
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $portfolio_settings['image_style'] . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $popuplink . '">';
                         }
                     }
                     /* gallery post */
                     if ($post_format == 'gallery') {
                         /* has external link */
                         if (!empty($external)) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= ut_portfolio_lightgallery($portfolio_query->post->ID, self::$token, $ut_page_hero_type);
                             } else {
                                 $gallery .= ut_portfolio_prettyphoto_gallery($portfolio_query->post->ID, self::$token, $ut_page_hero_type);
                             }
                             $gallery .= '<a class="ut-portfolio-popup-' . $portfolio_query->post->ID . ' ' . $portfolio_settings['image_style'] . '" title="' . $caption . '" href="' . $portfolio_detail_image . '">';
                         }
                     }
                 }
                 if (has_post_thumbnail() && !post_password_required()) {
                     $gallery .= '<figure><img alt="' . get_the_title() . '" width="' . $width . '" height="' . $height . '" src="' . UT_PORTFOLIO_URL . 'i/?w=' . $width . '&amp;h=' . $height . self::$cache . '" class="portfolio-lazy"  data-original="' . $thumbnail . '" /></figure>';
                 } elseif (post_password_required()) {
                     $gallery .= '<div class="ut-password-protected">' . __('Password Protected Portfolio', 'ut_portfolio_lang') . '</div>';
                 }
                 $gallery .= '<div class="ut-hover-layer">';
                 $gallery .= '<div class="ut-portfolio-info">';
                 $gallery .= '<div class="ut-portfolio-info-c">';
                 /* item title */
                 $gallery .= '<h2 class="portfolio-title">' . $title . '</h2>';
                 $gallery .= '<span>' . ut_generate_cat_list($portfolio_cats) . '</span>';
                 $gallery .= '</div>';
                 $gallery .= '</div>';
                 $gallery .= '</div>';
                 $gallery .= '</a>';
                 $gallery .= '</div>';
                 $gallery .= '</article>';
             }
             /* style two only images and title beneath */
             if ($gallery_style == 'style_two') {
                 /* create single portfolio item */
                 $gallery .= '<article class="' . $projecttype . ' ' . $itemposition . ' ut-masonry ' . $gutter . ' portfolio-style-two">';
                 $gallery .= '<div class="ut-portfolio-item ut-hover">';
                 /* link markup for slideup details */
                 if ($detailstyle == 'slideup') {
                     /* has external link */
                     if ($external) {
                         $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                     } else {
                         $gallery .= '<a class="ut-portfolio-link ' . $image_style_class . '" rel="bookmark" title="' . $title . '" data-wrap="' . self::$token . '" data-post="' . $portfolio_query->post->ID . '" href="#ut-portfolio-details-wrap-' . self::$token . '">';
                     }
                 }
                 /* link markup for image popup */
                 if ($detailstyle == 'popup') {
                     $popuplink = NULL;
                     /* image post or audio post */
                     if (empty($post_format) || $post_format == 'audio') {
                         /* has external link */
                         if ($external) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= '<div class="ut-new-hide" id="ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '"><h4>' . $title . '</h4><p>' . $caption . '</p></div>';
                             }
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $portfolio_settings['image_style'] . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $portfolio_detail_image . '">';
                         }
                     }
                     /* video post */
                     if ($post_format == 'video') {
                         /* has external link */
                         if (!empty($external)) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             /* get the content */
                             if (!empty($ut_page_hero_type) && $ut_page_hero_type == 'video') {
                                 /* youtube video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'youtube') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video', true);
                                 }
                                 /* selfhosted video - not supported by prettyphoto */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'selfhosted') {
                                     $popuplink = $fullsize;
                                 }
                                 /* custom video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'custom') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video_custom', true);
                                 }
                                 /* content is still empty - let's assign the regular content */
                                 if (empty($content)) {
                                     $content = get_the_content();
                                 }
                             } else {
                                 $content = get_the_content();
                             }
                             /* try to catch video url */
                             $popuplink = !empty($popuplink) ? $popuplink : ut_get_portfolio_format_video_content($content);
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= '<div class="ut-new-hide" id="ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '"><h4>' . $title . '</h4><p>' . $caption . '</p></div>';
                             }
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $portfolio_settings['image_style'] . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $popuplink . '">';
                         }
                     }
                     /* gallery post */
                     if ($post_format == 'gallery') {
                         /* has external link */
                         if ($external) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $title . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             if (self::$lightbox == 'ut-lightgallery') {
                                 $gallery .= ut_portfolio_lightgallery($portfolio_query->post->ID, self::$token, $ut_page_hero_type);
                             } else {
                                 $gallery .= ut_portfolio_prettyphoto_gallery($portfolio_query->post->ID, self::$token, $ut_page_hero_type);
                             }
                             $gallery .= '<a class="ut-portfolio-popup-' . $portfolio_query->post->ID . ' ' . $portfolio_settings['image_style'] . '" title="' . $title . '" href="#">';
                         }
                     }
                 }
                 if (has_post_thumbnail() && !post_password_required()) {
                     $gallery .= '<figure><img alt="' . get_the_title() . '" width="' . $width . '" height="' . $height . '" src="' . UT_PORTFOLIO_URL . 'i/?w=' . $width . '&amp;h=' . $height . self::$cache . '" class="portfolio-lazy"  data-original="' . $thumbnail . '" /></figure>';
                 } elseif (post_password_required()) {
                     $gallery .= '<div class="ut-password-protected">' . __('Password Protected Portfolio', 'ut_portfolio_lang') . '</div>';
                 }
                 $gallery .= '<div class="ut-hover-layer">';
                 $gallery .= '<div class="ut-portfolio-info">';
                 $gallery .= '<div class="ut-portfolio-info-c">';
                 if ($post_format == 'video') {
                     $gallery .= '<i class="fa fa-film fa-lg"></i>';
                 }
                 if ($post_format == 'audio') {
                     $gallery .= '<i class="fa fa-headphones fa-lg"></i>';
                 }
                 if ($post_format == 'gallery') {
                     $gallery .= '<i class="fa fa-camera-retro fa-lg"></i>';
                 }
                 if (empty($post_format)) {
                     $gallery .= '<i class="fa fa-picture-o fa-lg"></i>';
                 }
                 $gallery .= '<span>' . ut_generate_cat_list($portfolio_cats) . '</span>';
                 $gallery .= '</div>';
                 $gallery .= '</div>';
                 $gallery .= '</div>';
                 $gallery .= '</a>';
                 $gallery .= '<div>';
                 /* link markup for slideup details */
                 if ($detailstyle == 'slideup') {
                     $gallery .= '<a class="ut-portfolio-link ' . $portfolio_settings['image_style'] . '" rel="bookmark" title="' . $title . '" data-wrap="' . self::$token . '" data-post="' . $portfolio_query->post->ID . '" href="#ut-portfolio-details-wrap-' . self::$token . '">';
                 }
                 /* link markup for image popup */
                 if ($detailstyle == 'popup') {
                     $popuplink = NULL;
                     /* image post or audio post */
                     if (empty($post_format) || $post_format == 'audio') {
                         /* has external link */
                         if ($external) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $caption . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $image_style_class . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $portfolio_detail_image . '">';
                         }
                     }
                     /* video post */
                     if ($post_format == 'video') {
                         /* has external link */
                         if ($external) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $caption . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             /* get the content */
                             if (!empty($ut_page_hero_type) && $ut_page_hero_type == 'video') {
                                 /* youtube video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'youtube') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video', true);
                                 }
                                 /* selfhosted video - not supported by prettyphoto */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'selfhosted') {
                                     $popuplink = $fullsize;
                                 }
                                 /* custom video */
                                 if (isset($ut_page_video_source) && $ut_page_video_source == 'custom') {
                                     $content = get_post_meta($portfolio_query->post->ID, 'ut_page_video_custom', true);
                                 }
                                 /* content is still empty - let's assign the regular content */
                                 if (empty($content)) {
                                     $content = get_the_content();
                                 }
                             } else {
                                 $content = get_the_content();
                             }
                             /* try to catch video url */
                             $popuplink = !empty($popuplink) ? $popuplink : ut_get_portfolio_format_video_content($content);
                             $gallery .= '<a data-rel="' . self::$lightbox . '" class="' . $portfolio_settings['image_style'] . '" data-sub-html="#ut-lightgallery-sub-html-' . $portfolio_query->post->ID . '" title="' . $caption . '" href="' . $popuplink . '">';
                         }
                     }
                     /* gallery post */
                     if ($post_format == 'gallery') {
                         /* has external link */
                         if ($external) {
                             $gallery .= '<a class="' . $image_style_class . '" rel="bookmark" title="' . $caption . '" href="' . $external . '" target="' . $target . '">';
                         } else {
                             $gallery .= '<a class="ut-portfolio-popup-' . $portfolio_query->post->ID . ' ' . $portfolio_settings['image_style'] . '" title="' . $title . '" href="#">';
                         }
                     }
                 }
                 /* item title */
                 $gallery .= '<h2 class="portfolio-title">' . $title . '</h2>';
                 $gallery .= '</a>';
                 $gallery .= '</div>';
                 $gallery .= '</div>';
                 $gallery .= '</article>';
             }
             $z++;
         }
     }
     /* end portfolio container */
     $gallery .= '</div>';
     /* portfolio pagination */
     if ($portfolio_query->max_num_pages > 1) {
         $gallery .= '<nav class="ut-portfolio-pagination clearfix ' . (!empty($gallery_options['filter_style']) ? $gallery_options['filter_style'] : 'style_one') . '">';
         if ($paged > 1) {
             $gallery .= '<a href="?paged=' . ($paged - 1) . '&amp;portfolioID=' . self::$token . '&amp;termID=' . $term . '#ut-portfolio-items-' . self::$token . '-anchor"><i class="fa fa-angle-double-left"></i></a>';
         }
         for ($i = 1; $i <= $portfolio_query->max_num_pages; $i++) {
             $selected = $paged == $i || empty($paged) && $i == 1 ? 'selected' : '';
             $gallery .= '<a href="?paged=' . $i . '&amp;portfolioID=' . self::$token . '&amp;termID=' . $term . '#ut-portfolio-items-' . self::$token . '-anchor" class="' . $selected . '">' . $i . '</a>';
         }
         if ($paged < $portfolio_query->max_num_pages) {
             $paged_next = $paged == 0 ? $paged + 1 : $paged;
             $gallery .= '<a href="?paged=' . ($paged_next + 1) . '&amp;portfolioID=' . self::$token . '&amp;termID=' . $term . '#ut-portfolio-items-' . self::$token . '-anchor"><i class="fa fa-angle-double-right"></i></a>';
         }
         $gallery .= '</nav>';
     }
     /* end portfolio wrap */
     $gallery .= '</div>';
     /* restore wp_query */
     $wp_query = null;
     $wp_query = $temp;
     /* reset query */
     wp_reset_postdata();
     /* return final gallery */
     return $gallery;
 }
Exemple #6
0
                             
    </header><!-- close entry-header -->   
    
     <?php 
/* check if featured has been set and display it */
?>
    
    <?php 
if (has_post_thumbnail() && !post_password_required()) {
    ?>
   		
        <!-- ut-post-thumbnail -->
    	<div class="ut-post-thumbnail">     
		
		<?php 
    $thumbnail = ut_resize($fullsize, '855', '425', true, true);
    ?>
        <?php 
    $caption = get_post($fullsizeID)->post_excerpt;
    ?>
	
        
        <?php 
    if (is_single()) {
        ?>
        	<div class="entry-thumbnail">		
				<img alt="<?php 
        echo $caption;
        ?>
" class="wp-post-image" src="<?php 
        echo $thumbnail;
    function ut_flex_slider($postID, $shortcode = false)
    {
        $flex_slider = NULL;
        /* get all necessary image ID's */
        $ut_gallery_images = ut_extract_gallery_images_ids();
        /* start output */
        if (isset($ut_gallery_images) && is_array($ut_gallery_images)) {
            $flex_slider = '
		
		<script type="text/javascript">
        /* <![CDATA[ */
        
		(function($){
			
			"use strict";
	
			$(window).load(function(){
				
				$("#gallery-slider-' . $postID . '").flexslider({
					
					controlNav: false,
                    animationLoop: true,
                   	slideshow: true,
					smoothHeight: true,
					start: function(){
						$("#gallery-slider-' . $postID . '").addClass("loaded");
					}
					
				});
				
			});
		
		})(jQuery);
        
        /* ]]> */
        </script>
		
		<div class="ut-gallery-wrap">
            <div class="ut-gallery-slider flexslider" id="gallery-slider-' . $postID . '">
                <ul class="slides">';
            foreach ($ut_gallery_images as $ID => $imagedata) {
                if (isset($imagedata->guid) && !empty($imagedata->guid)) {
                    $image = $imagedata->guid;
                    // fallback to older wp versions
                } else {
                    if ($shortcode) {
                        $image = wp_get_attachment_image_src($imagedata, 'medium');
                    } else {
                        $image = wp_get_attachment_image_src($imagedata, 'single-post-thumbnail');
                    }
                    $image = $image[0];
                }
                if (!empty($image[0])) {
                    $flex_slider .= '<li>';
                    if ($shortcode) {
                        $thumbnail = $image;
                    } else {
                        $thumbnail = ut_resize($image, '855', '425', true, true, true);
                    }
                    $flex_slider .= '<img alt="' . get_the_title($postID) . '" src="' . $thumbnail . '" />';
                    $flex_slider .= '</li>';
                }
            }
            $flex_slider .= '
				</ul>
            </div>
        </div>';
        }
        return $flex_slider;
    }