$value) { $categories[] = $value['value']; } } else { $categories = array(); } if (isset($attributes['tags']) && ! empty($attributes['tags']) && is_array($attributes['tags'])) { $tags = array(); $i = 1; foreach ($attributes['tags'] as $key => $value) { $tags[] = $value['value']; } } else { $tags = array(); } /* Setup the query */ $query_args = array( 'posts_per_page' => $attributes['postsToShow'], 'post_status' => 'publish', 'order' => $attributes['order'], 'orderby' => $attributes['orderBy'], 'offset' => $attributes['offset'], 'post_type' => $attributes['postType'], 'ignore_sticky_posts' => 1, ); if ($attributes['taxType'] == 'category') { $query_args['category__in'] = $categories; } if ($attributes['taxType'] == 'post_tag') { $query_args['tag__in'] = $tags; } if ($attributes['taxType'] != 'category' && $attributes['taxType'] != 'post_tag') { $tax_type = $attributes['taxType']; if ($tax_type) { $query_args['tax_query'][] = array( 'taxonomy' => (isset($tax_type)) ? $tax_type : 'category', 'field' => 'id', 'terms' => $categories, 'operator' => 'IN', ); } } $grid_query = new WP_Query($query_args); $responsivelayoutTab = 1; $responsivelayoutMobile = 1; $verticals = false; if ($attributes['carouselType'] == 'vertical') { $verticals = true; } /* Start the loop */ if ($grid_query->have_posts()) { $alignclass = blockspare_checkalignment($attributes['align'], $attributes); /* Build the block classes */ $class = 'align' . $alignclass; if (isset($attributes['class'])) { $class .= ' ' . $attributes['class']; } if ($attributes['animation']) { $class .= ' blockspare-block-animation ' . $attributes['animation']; } //$list_layout_class = $attributes['trending']; $listgridClass = 'blockspare-posts-block-is-carousel'; /* Layout orientation class */ $block_post_wrap = $blockuniqueclass . ' blockspare-posts-block-post-wrap'; $count = 0; $layout_class = 'bs-flash-wrap flash-layout ' . $attributes['layoutStyle']; if ($attributes['fixedWidth']) { $layout_class .= ' has-fixed-width'; } $exclusive_posts = 'bs-exclusive-posts blockspare-hover-item'; if ($attributes['border']) { $exclusive_posts .= ' bs-border-enabled bs-' . $attributes['borderStyle']; } else { $exclusive_posts .= ' bs-border-disabled'; } $flash_spiner_class = 'bs-spinner '; if ($attributes['spinnerOption'] == 'spinner-option-1') { $flash_spiner_class .= $attributes['spinnerStyle']; } else { $flash_spiner_class .= $attributes['animationStyle']; } $spinner_icon = $attributes['spinnerIcon']; $marquee_class = 'bs-marquee bs-flash-side ' . $attributes['direction']; if ($attributes['pauseOnHover']) { $marquee_class .= ' pause-on-hover'; } ?>