<?php } ?> <div class="work-description"> <h3><?php the_title(); ?> </h3> <?php $read_more_button = yiw_get_option('portfolio_show_view_project') ? $yiw_portfolio[$post_type]['read_more'] : ''; ?> <?php echo yiw_content('content', 25, $read_more_button); ?> </div> <div class="clear"></div> </div> <?php } ?> </div> <?php if (function_exists('yiw_pagination')) { yiw_pagination($portfolio->max_num_pages);
/** * testimonials slider * * @description * Show all post on testimonials post types * * @example * [testimonials_slider items=""] * * @params * items - number of item to show * **/ function yiw_sc_testimonials_slider_func($atts, $content = null) { extract(shortcode_atts(array("items" => -1, 'speed' => 500, 'timeout' => 7000, 'excerpt' => 20, 'link' => true, 'category' => ''), $atts)); $args = array('post_type' => 'bl_testimonials', 'posts_per_page' => $items); if (!empty($category)) { $args['tax_query'] = array(array('taxonomy' => 'category-testimonial', 'field' => 'slug', 'terms' => array_map('trim', explode(',', $category)))); } $tests = new WP_Query($args); $count_posts = wp_count_posts('bl_testimonials'); if ($count_posts->publish == 1) { $is_slider = false; } else { $is_slider = true; } $html = ''; if (!$tests->have_posts()) { return $html; } ob_start(); ?> <div class="testimonials-slider"> <ul class="testimonials group"> <?php //loop $c = 0; while ($tests->have_posts()) { $tests->the_post(); $website = get_post_meta(get_the_ID(), '_testimonial_website', true); ?> <li> <blockquote><p class="special-font"><?php if ($link) { ?> <a href="<?php the_permalink(); ?> "><?php } ?> “<?php echo strip_tags(yiw_content('excerpt', $excerpt)); ?> ”<?php if ($link) { ?> </a><?php } ?> </p></blockquote> <p class="meta"><a href="<?php the_permalink(); ?> "><?php the_title('<strong>', '</strong>'); ?> </a> - <a href="<?php echo esc_url($website); ?> "><?php echo $website; ?> </a></p> </li> <?php $c++; } wp_reset_query(); ?> </ul> <?php if ($is_slider) { ?> <div class="prev"></div> <div class="next"></div> <?php } ?> </div> <?php if ($is_slider) { ?> <script type="text/javascript"> jQuery(function($){ $('.testimonials-slider ul').cycle({ fx : 'scrollHorz', speed: <?php echo $speed; ?> , timeout: <?php echo $timeout; ?> , next: '.testimonials-slider .next', prev: '.testimonials-slider .prev' }); }); </script> <?php } $html = ob_get_clean(); return apply_filters('yiw_sc_testimonials_slider_html', $html); }