getShortcode(), $atts ); extract( $atts ); global $vc_posts_grid_exclude_id; $vc_posts_grid_exclude_id[] = get_the_ID(); // fix recursive nesting if ( is_array( $posts_query ) ) { $posts_query['post_status'] = 'publish'; } else { $posts_query .= '|post_status:publish'; } list( $args, $my_query ) = vc_build_loop_query( $posts_query, get_the_ID() ); $teaser_blocks = vc_sorted_list_parse_value( $layout ); /** @var $my_query WP_Query */ while ( $my_query->have_posts() ) { $my_query->the_post(); // Get post from query if ( in_array( get_the_ID(), $vc_posts_grid_exclude_id ) ) { continue; } $post = new stdClass(); // Creating post object. $post->id = get_the_ID(); $post->link = get_permalink( $post->id ); $post->post_type = get_post_type(); if ( '1' === $vc_teaser_box->getTeaserData( 'enable', $post->id ) ) { $post->custom_user_teaser = true; $data = $vc_teaser_box->getTeaserData( 'data', $post->id ); if ( ! empty( $data ) ) { $data = json_decode( $data ); } $post->bgcolor = $vc_teaser_box->getTeaserData( 'bgcolor', $post->id ); $post->custom_teaser_blocks = array(); $post->title_attribute = the_title_attribute( 'echo=0' ); if ( ! empty( $data ) ) { foreach ( $data as $block ) { $settings = array(); if ( 'title' === $block->name ) { $post->title = the_title( '', '', false ); } elseif ( 'image' === $block->name ) { if ( 'featured' === $block->image ) { $post->thumbnail_data = $this->getPostThumbnail( $post->id, $thumb_size ); } elseif ( ! empty( $block->image ) ) { $post->thumbnail_data = wpb_getImageBySize( array( 'attach_id' => (int) $block->image, 'thumb_size' => $thumb_size, ) ); } else { $post->thumbnail_data = false; } $post->thumbnail = $post->thumbnail_data && isset( $post->thumbnail_data['thumbnail'] ) ? $post->thumbnail_data['thumbnail'] : ''; $post->image_link = empty( $video ) && $post->thumbnail && isset( $post->thumbnail_data['p_img_large'][0] ) ? $post->thumbnail_data['p_img_large'][0] : $video; } elseif ( 'text' === $block->name ) { if ( 'custom' === $block->mode ) { $settings[] = 'text'; $post->content = $block->text; } elseif ( 'excerpt' === $block->mode ) { $settings[] = $block->mode; $post->excerpt = $this->getPostExcerpt(); } else { $settings[] = $block->mode; $post->content = $this->getPostContent(); } } if ( isset( $block->link ) ) { if ( 'post' === $block->link ) { $settings[] = 'link_post'; } elseif ( 'big_image' === $block->link ) { $settings[] = 'link_image'; } else { $settings[] = 'no_link'; } $settings[] = ''; } $post->custom_teaser_blocks[] = array( $block->name, $settings ); } } } else { $post->custom_user_teaser = false; $post->title = the_title( '', '', false ); $post->title_attribute = the_title_attribute( 'echo=0' ); $post->post_type = get_post_type(); $post->content = $this->getPostContent(); $post->excerpt = $this->getPostExcerpt(); $post->thumbnail_data = $this->getPostThumbnail( $post->id, $thumb_size ); $post->thumbnail = $post->thumbnail_data && isset( $post->thumbnail_data['thumbnail'] ) ? $post->thumbnail_data['thumbnail'] : ''; $video = get_post_meta( $post->id, '_p_video', true ); $post->image_link = empty( $video ) && $post->thumbnail && isset( $post->thumbnail_data['p_img_large'][0] ) ? $post->thumbnail_data['p_img_large'][0] : $video; } $post->categories_css = $this->getCategoriesCss( $post->id ); $posts[] = $post; } wp_reset_query(); $this->setLinkTarget( $link_target ); wp_enqueue_script( 'vc_carousel_js' ); wp_enqueue_style( 'vc_carousel_css' ); $css_class = $this->settings['base'] . ' wpb_content_element vc_carousel_slider_' . $slides_per_view . ' vc_carousel_' . $mode . ( empty( $el_class ) ? '' : ' ' . $el_class ); $carousel_id = esc_attr( 'vc_carousel-' . WPBakeryShortCode_Vc_Carousel::getCarouselIndex() ); ?>
$title, 'extraclass' => 'wpb_gallery_heading' ) ) ?>