'
. $widget_args['before_widget']
. (!empty($widget_title) ? $widget_args['before_title'] .esc_html($widget_title). $widget_args['after_title'] : '');
}
// Wrapper
$output .= '
';
// Header
if ( !empty($title) || !empty($subtitle) || (lorem_ipsum_books_media_store_param_is_on($show_categories) && !lorem_ipsum_books_media_store_storage_empty('categories_'.$category)) ) {
$output .= '';
}
// Columns
if ($columns > 1)
$output .= '
';
global $post;
$args = array(
'post_type' => $post_type,
'post_status' => 'publish',
'posts_per_page' => $count,
'ignore_sticky_posts' => true,
'order' => $order=='asc' ? 'asc' : 'desc'
);
if ($offset > 0 && empty($ids)) {
$args['offset'] = $offset;
}
$args = lorem_ipsum_books_media_store_query_add_sort_order($args, $orderby, $order);
$args = lorem_ipsum_books_media_store_query_add_posts_and_cats($args, $ids, $post_type, $category, $taxonomy);
$query = new WP_Query( $args );
$count = min($count, $query->found_posts);
$featured = max(0, min($count, (int) $featured));
$columns = max(1, min(12, (int) $columns));
if (in_array($style, array('news-announce', 'news-excerpt'))) $columns = 1;
if ($featured > 0) $columns = min($featured+1, $columns); // Columns <= Featured + 1
$post_number = 0;
while ( $query->have_posts() ) { $query->the_post();
$post_number++;
$args = array(
'layout' => $style,
'show' => false,
'number' => $post_number,
'posts_on_page' => $count,
'columns_count' => $columns,
'featured' => $featured,
'tag_id' => $id ? $id . '_' . $post_number : '',
'tag_class' => '',
'tag_animation' => '',
'tag_css' => '',
'show_counters' => $show_counters,
'content' => false,
'terms_list' => true
);
$output .= lorem_ipsum_books_media_store_show_post_layout($args);
}
wp_reset_postdata();
if ($columns > 1) $output .= '
';
$output .= '
';
if (empty($from_widget)) $output .= $widget_args['after_widget'] . '