';
$stype = 'thumb';
} else if($type == 'different-ratio') {
$crop = false;
$imgwidth = null;
}else if($type == 'carousel') {
$crop = false;
$imgwidth = null;
$width = 'none';
$stype = 'carousel';
$fade = 'false';
$class .= ' kt-image-carousel';
}
if(!empty($slides)) :
echo '
';
foreach ($slides as $slide) {
$alt = get_post_meta($slide['attachment_id'], '_wp_attachment_image_alt', true);
$img = ascend_get_image(80, 80, true, null, $alt, $slide['attachment_id'], false);
echo '
';
echo '
!['.esc_attr($img['alt']).']('.esc_url($img['src']).')
';
echo '
';
echo '
';
}
echo '
';
echo ' ';
}
endif;
}
}
if(!function_exists('ascend_build_slider_home_fullwidth')) {
function ascend_build_slider_home_fullwidth($slides = null, $width = null, $height = null, $class = null, $id = 'kt_slider_options', $type = 'slider', $captions = "false", $auto = 'true', $speed = '7000', $arrows = 'true', $fade = 'true', $fade_speed = '400', $title_max = '70', $title_min = '40', $subtitle_max = '30', $subtitle_min = '20', $align = 'center') {
$stype = 'slider';
if(!empty($slides)) :
echo '';
}
if(!empty($images)) :
echo '
';
$attachments = array_filter( explode( ',', $images ) );
if ($attachments) {
foreach ($attachments as $attachment) {
$alt = get_post_meta($attachment, '_wp_attachment_image_alt', true);
$img = ascend_get_image($width, $height, true, null, $alt, $attachment, false);
echo '
';
}
}
echo '
';
if($type == 'thumb') {
echo '
';
$attachments = array_filter( explode( ',', $images ) );
if ($attachments) {
foreach ($attachments as $attachment) {
$alt = get_post_meta($attachment, '_wp_attachment_image_alt', true);
$img = ascend_get_image(80, 80, true, null, $alt, $attachment, false);
echo '
';
echo '
!['.esc_attr($img['alt']).']('.esc_url($img['src']).')
';
echo '
';
echo '
';
}
}
echo '
';
}
endif;
}
}
if(!function_exists('ascend_build_post_carousel')) {
function ascend_build_post_carousel($width = null, $height = 400, $class = null, $type = 'post', $cat = null, $items = 8, $orderby = 'date', $order = 'DESC', $offset = null, $auto = 'true', $speed = '7000', $arrows = 'true', $trans_speed = '400', $featured = null) {
$extraargs = array();
if($type == 'portfolio') {
$tax = 'portfolio-type';
} elseif($type == 'product') {
if($featured == 'true'){
$extraargs = array(
'meta_key' => '_featured',
'meta_value' => 'yes',
);
}
$tax = 'product_cat';
} else if($type == 'staff') {
$tax = 'staff-group';
} else if($type == 'testimonal') {
$tax = 'testimonal-group';
} else {
$tax = 'category';
}
if(!empty($cat)) {
$cat = get_term($cat, $tax);
$cat = $cat->slug;
}
$args = array(
'orderby' => $orderby,
'order' => $order,
'post_type' => $type,
'offset' => $offset,
'post_status' => 'publish',
$tax => $cat,
'posts_per_page' => $items,
);
$args = array_merge($args, $extraargs);
echo '
';
if(isset($wp_query)) {
$temp = $wp_query;
} else {
$temp = null;
}
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query($args);
if ( $wp_query ) :
while ( $wp_query->have_posts() ) : $wp_query->the_post();
global $post;
$img = ascend_get_image($width , $height, true, null, null, null, true);
echo '
';
echo '
';
echo '
!['.esc_attr($img['alt']).']('.esc_url($img['src']).')
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
echo ''.get_the_title().'
';
echo '';
echo '
';
echo '
';
if($type == 'product') {
if(function_exists('woocommerce_template_loop_price')) {
woocommerce_template_loop_price();
}
} else if($type != 'post') {
the_terms($post->ID, $tax, '', ' | ', '');
} else {
the_category(' | ');
}
echo '
';
echo '
';
echo '
';
echo '
';
echo '
';
endwhile; else:
echo '
'.__('Sorry, no entries found.', 'ascend').'';
endif;
$wp_query = null;
$wp_query = $temp; // Reset
wp_reset_query();
echo '
';
}
}