';
// Add filter
if($filter && $filter != 'disabled' && empty($cat) && $type !== 'grid' && $type !== 'slider' && $type !== 'full-slider'){
// TODO: Get categories for filtering.
wp_enqueue_script('flatsome-isotope-js');
?>
'featured_item',
);
// Exclude
// If custom Ids
if ( isset( $atts['ids'] ) ) {
$ids = explode( ',', $atts['ids'] );
$ids = array_map( 'trim', $ids );
$args['post__in'] = $ids;
$args['posts_per_page'] = -1;
$args['orderby'] = 'post__in';
} else {
$args['offset'] = $offset;
$args['order'] = $order;
$args['orderby'] = $orderby;
if($exclude) $args['post__not_in'] = explode( ',', $exclude );
$args['posts_per_page'] = $number;
if ( !empty( $atts['cat'] ) ) {
$args['tax_query'] = array(
array(
'taxonomy' => 'featured_item_category',
'field' => 'id',
'terms' => $cat,
),
);
}
}
$wp_query = new WP_Query( $args );
// Get repeater structure
get_flatsome_repeater_start($repeater);
?>
have_posts() ) :
while ($wp_query->have_posts()) : $wp_query->the_post();
$link = get_permalink(get_the_ID());
$has_lightbox = '';
if($lightbox == 'true'){
$link = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), $lightbox_image_size );
$link = $link[0];
$has_lightbox = 'lightbox-gallery';
}
$image = get_post_thumbnail_id();
$classes_col = array('col');
// Add Columns for Grid style
if($type == 'grid'){
if($grid_total > $current_grid) $current_grid++;
$current = $current_grid-1;
$classes_col[] = 'grid-col';
if($grid[$current]['height']) $classes_col[] = 'grid-col-'.$grid[$current]['height'];
if($grid[$current]['span']) $classes_col[] = 'large-'.$grid[$current]['span'];
if($grid[$current]['md']) $classes_col[] = 'medium-'.$grid[$current]['md'];
// Set image size
if($grid[$current]['size']) $image_size = $grid[$current]['size'];
}
?>
';
$args = array(
'image_width' => array(
'selector' => '.box-image',
'property' => 'width',
'unit' => '%',
),
'text_padding' => array(
'selector' => '.box-text',
'property' => 'padding',
),
);
echo ux_builder_element_style_tag($_id, $args, $atts);
$content = ob_get_contents();
ob_end_clean();
return $content;
}
add_shortcode("featured_items_slider", "flatsome_portfolio_shortcode");
add_shortcode("featured_items_grid", "flatsome_portfolio_shortcode");
add_shortcode("ux_portfolio", "flatsome_portfolio_shortcode");