$orderby = 'post__in';
}
// Lets create a new Query so the image grid can be paginated
$my_query = new WP_Query(array('post_type' => 'attachment', 'post_status' => 'any', 'posts_per_page' => -1, 'paged' => NULL, 'no_found_rows' => true, 'post__in' => $attachment_ids, 'orderby' => $orderby));
// Display carousel if there are images
if ($my_query->have_posts()) {
    // Image Classes
    $img_classes = array('wpex-carousel-entry-media', 'clr');
    if ('yes' == $rounded_image) {
        $img_classes[] = ' wpex-rounded-images';
    }
    if ($overlay_style) {
        $img_classes[] = wpex_overlay_classes($overlay_style);
    }
    if ($img_filter) {
        $img_classes[] = wpex_image_filter_class($img_filter);
    }
    if ($img_hover_style) {
        $img_classes[] = wpex_image_hover_classes($img_hover_style);
    }
    $img_classes = implode(' ', $img_classes);
    // Lightbox links
    if ('lightbox' == $thumbnail_link) {
        vcex_enque_style('ilightbox', $lightbox_skin);
        $atts['lightbox_data'] = array();
        $atts['lightbox_data'][] = 'data-type="image"';
        if ($lightbox_skin) {
            $atts['lightbox_data'][] = 'data-skin="' . $lightbox_skin . '"';
        }
    }
    // Output js for front-end editor
Example #2
0
        } else {
            $large_img_src = wp_get_attachment_image_src($img_id, 'large');
            if ($large_img_src) {
                $large_img_src = $large_img_src[0];
            }
        }
        $img['thumbnail'] = str_replace('<img ', '<img data-vc-zoom="' . $large_img_src . '" ', $img['thumbnail']);
        break;
}
// backward compatibility
if (vc_has_class('prettyphoto', $el_class)) {
    $el_class = vc_remove_class('prettyphoto', $el_class);
}
// Image Filter - TOTAL THEME
if (!empty($img_filter)) {
    $img_filter = ' ' . wpex_image_filter_class($img_filter);
}
// Image - Hover
if (!empty($img_hover)) {
    $img_hover = ' ' . wpex_image_hover_classes($img_hover);
}
$html = 'vc_box_shadow_3d' === $style ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail'];
// TOTAL OVERLAY CAPTION
if ($img_caption) {
    $html .= '<span class="wpb_single_image_caption">' . $img_caption . '</span>';
}
// TOTAL OVERLAY CAPTION END
$wrapper_classes = 'vc_single_image-wrapper';
if ($style) {
    $wrapper_classes .= ' ' . $style;
    $wrapper_classes .= ' ' . $border_color;
    // Add data attributes
    $data_attributes .= ' data-type="image"';
    // Add link class
    $a_class .= ' wpex-lightbox';
} elseif (!empty($img_link)) {
    $link_to = $img_link;
}
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element clr' . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts);
if ($css_animation) {
    $css_class .= $this->getCSSAnimation($css_animation);
}
if ('yes' == $rounded_image) {
    $css_class .= ' vcex-rounded-images';
}
if ($img_filter) {
    $css_class .= ' ' . wpex_image_filter_class($img_filter);
}
// Image output
$img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail'];
// Caption
if ($img_caption) {
    $img_output .= '<span class="wpb_single_image_caption">' . $img_caption . '</span>';
}
// Default image string
$image_string = !empty($link_to) ? '<div class="' . $wrapper_classes . '"><a class="' . $a_class . '" href="' . $link_to . '"' . ' target="' . $img_link_target . '"' . '' . $data_attributes . '>' . $img_output . '</a></div>' : '<div class="' . $wrapper_classes . '">' . $img_output . '</div>';
$css_class .= $this->getCSSAnimation($css_animation);
if ($alignment) {
    $css_class .= ' vc_align_' . $alignment;
}
$output .= "\n\t" . '<div class="' . $css_class . '">';
$output .= "\n\t\t" . '<div class="wpb_wrapper">';