function vntd_portfolio_carousel($atts, $content = null)
{
    extract(shortcode_atts(array("cats" => '', "posts_nr" => '6', "thumb_style" => ''), $atts));
    wp_enqueue_script('prettyPhoto', '', '', '', true);
    wp_enqueue_style('prettyPhoto');
    wp_enqueue_script('owl-carousel', '', '', '', true);
    wp_enqueue_style('owl-carousel');
    ob_start();
    echo '<div class="vntd-portfolio-carousel"><div class="works white">';
    $size = 'portfolio-square';
    wp_reset_postdata();
    $args = array('posts_per_page' => $posts_nr, 'project-type' => $cats, 'post_type' => 'portfolio', 'orderby' => 'slug');
    $the_query = new WP_Query($args);
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $img_url = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), $size);
            $thumb_url = $img_url[0];
            ?>
		
		<!-- Item -->
		<div class="item">
			<!-- Image, Buttons -->
			<div class="f-image">
				<!-- Image -->
				<img src="<?php 
            echo $thumb_url;
            ?>
" alt="<?php 
            echo the_title();
            ?>
">

				<!-- Hover Tags, Link -->
				<div class="f-button first">
					<a href="<?php 
            echo get_permalink();
            ?>
" class="featured-ball first ex-link" >
						<i class="fa fa-link"></i>
					</a>
				</div>
				<!-- End Link -->

				<!-- Detail -->
				<div class="f-button second">
					<a href="<?php 
            echo $thumb_url;
            ?>
" data-rel="prettyPhoto[featured-work]" class="featured-ball second">
						<i class="fa fa-plus"></i>
					</a>
				</div>
				<!-- End Detail -->
			</div>
			<!-- End Image, Buttons -->

			<!-- Texts -->
			<div class="texts">
				<!-- Item Header -->
				<h1 class="f-head font-primary normal uppercase">
					<?php 
            the_title();
            ?>
				</h1>

				<!-- Item Description -->
				<h2 class="f-text font-secondary normal">
					<?php 
            vntd_portfolio_overlay_categories();
            ?>
				</h2>
			</div>
			<!-- End Texts -->
		</div>
		<!-- End Item -->
	
	<?php 
        }
    }
    wp_reset_postdata();
    echo '</div>';
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
function vntd_related_work()
{
    global $post;
    $cols = 4;
    $title = $nav_style = $url = '';
    $thumb_size = 'portfolio-square';
    echo '<div id="related-work" class="vntd-carousel portfolio-carousel vntd-carousel-nav-side portfolio-style-default vntd-cols-' . $cols . '" data-cols="' . $cols . '">';
    echo '<h3>' . __('Related Work', 'vntd_north') . '</h3>';
    vntd_carousel_heading($title, $nav_style, $url);
    echo '<div class="carousel-overflow"><div class="carousel-holder vntd-row"><ul>';
    wp_reset_postdata();
    $args = array('posts_per_page' => 8, 'project-type' => $cats, 'post_type' => 'portfolio', 'post__not_in' => array($post->ID));
    $the_query = new WP_Query($args);
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) {
            $the_query->the_post();
            echo '<li class="carousel-item span' . vntd_carousel_get_cols($cols) . '">';
            ?>
	
						
				<div class="portfolio-thumbnail-holder thumbnail-default hover-item">
					<a href="<?php 
            echo get_permalink();
            ?>
" class="noSwipe portfolio-thumbnail">
						<img src="<?php 
            echo vntd_thumb(460, 345);
            ?>
" alt>			    
						<span class="hover-icon hover-icon-link"></span>
					</a>
					
					<div class="portfolio-thumbnail-caption">
					    <h4 class="caption-title"><a href="<?php 
            echo get_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h4>
					    <span class="caption-categories"><?php 
            vntd_portfolio_overlay_categories();
            ?>
</span>					    
					</div>			
				</div>
			
			<?php 
            echo '</li>';
        }
    }
    wp_reset_postdata();
    echo '</ul></div></div></div>';
}
Esempio n. 3
0
function vntd_portfolio_grid($atts, $content = null)
{
    extract(shortcode_atts(array("filter" => 'yes', "posts_nr" => '', "cats" => '', "thumb_size" => 'square', "order" => '', "el_position" => '', "width" => '', "composer" => '', "paged_posts" => '', "more_url" => '', "thumb_space" => 'yes', "cols" => '5', "thumb_size" => 'square', "link_type" => 'ajax'), $atts));
    // Define container and item span value
    global $post;
    if (!$posts_nr) {
        $posts_nr = "-1";
    }
    $block_id = rand(5, 5000);
    $layout_class = '';
    $item_class = 'boxed-item col-xs-4';
    if ($thumb_space == 'no') {
        $layout_class = 'fullwidth relative';
        $item_class = 'five';
        if ($cols == "4") {
            $item_class = 'four';
        }
    }
    if ($link_type != 'direct' && $link_type != 'external') {
        wp_enqueue_script('portfolioExpand', '', '', '', true);
        wp_enqueue_style('portfolioExpand');
    }
    ob_start();
    echo '<div class="portfolio t-center ' . $layout_class . '"><div class="vntd-grid-before"></div>';
    if ($filter == "yes") {
        vntd_portfolio_filters($cats);
    }
    echo '<div class="portfolio-items">';
    wp_reset_postdata();
    $paged = '';
    if ($paged_posts == 'yes') {
        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    }
    //echo $cats_arr."ECHO TEST | | ".$cats;
    $cats_arr = explode(" ", $cats);
    $args = array('posts_per_page' => $posts_nr, 'project-type' => $cats, 'paged' => $paged, 'post_type' => 'portfolio');
    $the_query = new WP_Query($args);
    // Default Thumbnail Sizes
    $size = "portfolio-square";
    if ($thumb_size == "auto") {
        $size = "portfolio-auto";
    }
    //$size = "portfolio-auto";
    $data_content = $ajax_class = '';
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $img_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size);
            $thumb_url = $img_url[0];
            $post_link = get_permalink();
            $post_link_type = get_post_meta($post->ID, 'link_type', TRUE);
            if ($link_type != 'direct' && $post_link_type != 'direct') {
                $data_content = ' data-content="' . get_permalink() . '"';
                $ajax_class = ' colio-link';
            }
            if ($post_link_type == 'external' && get_post_meta($post->ID, 'portfolio_external_url', TRUE)) {
                $data_content = '';
                $ajax_class = '';
                $post_link = get_post_meta($post->ID, 'portfolio_external_url', TRUE);
            }
            ?>
				
					<div class="item <?php 
            echo $item_class;
            ?>
 <?php 
            echo vntd_portfolio_item_class();
            ?>
"<?php 
            echo $data_content;
            ?>
>
						<!-- Item Inner -->
						<div class="item-inner">
							<!-- Item Link -->
							<a href="<?php 
            echo $post_link;
            ?>
" class="work-image<?php 
            echo $ajax_class;
            ?>
">
								<!-- Item Image -->
								<img src="<?php 
            echo $thumb_url;
            ?>
" alt="<?php 
            the_title();
            ?>
">
								<!-- Item Details -->
								<div class="item-details">
									<!-- Item Header -->
									<h1 class="portfolio-grid-title white"><?php 
            the_title();
            ?>
</h1>
									<!-- Item Strips -->
									<span class="portfolio-strips"></span>
									<!-- Item Description -->
									<p class="font-primary uppercase">
										<?php 
            vntd_portfolio_overlay_categories();
            ?>
									</p>
								</div>
								<!-- End Item Details -->
							</a>
							<!-- End Item Link -->
						</div>
						<!-- End Item Inner -->
					</div>
					
					<?php 
            $data_content = $ajax_class = '';
        }
    }
    ?>

	<?php 
    if ($paged_posts == 'yes') {
        vntd_pagination($the_query);
    }
    wp_reset_postdata();
    echo '</div>';
    if ($more_url) {
        echo '<a href="' . $more_url . '" class="portfolio-view-more uppercase ex-link"><i class="fa fa-plus fa-3x"></i></a>';
    }
    echo '</div>';
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}