function zn_gallery($atts) { extract(shortcode_atts(array('order' => 'ASC', 'ids' => '', 'size' => 'col-sm-9', 'style' => 'thumbnails', 'columns' => 3), $atts)); $output = ''; $attachments = get_posts(array('include' => $ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => 'post__in')); if (!empty($attachments) && is_array($attachments)) { global $zn_config; if (!empty($zn_config['size'])) { $size = $zn_config['size']; } $size = zn_get_wp_image_size($size); $output = '<div class="post_media carouselContainer">'; $output .= ' <ul class="galleryCarousel magPopupUl" data-gallery-columns="' . $columns . '">'; foreach ($attachments as $attachment) { //$img = wp_get_attachment_image( $attachment->ID , $size); $imgAttr = array('class' => "img-responsive animate"); $img = zn_get_image($attachment->ID, $size['width'], $size['height'], $imgAttr, true); $output .= '<li class="scaleRotateImg">'; $output .= $img; $output .= '</li>'; } $output .= ' </ul>'; $output .= '<span class="Prev animate"><img width="50" height="90" alt="Previous" src="' . THEME_BASE_URI . '/images/prev.png" /></span>'; $output .= '<span class="Next animate"><img width="50" height="90" alt="Next" src="' . THEME_BASE_URI . '/images/next.png" /></span>'; $output .= '</div>'; } return $output; }
<?php global $zn_config; $size = zn_get_wp_image_size($zn_config['size']); $post_data['media'] = zn_get_post_image(get_the_ID(), $size['width'], $size['height'], array('class' => "img-responsive animate")); $post_data['media'] = !empty($post_data['media']) ? '<div class="mediaContainer scaleRotateImg">' . $post_data['media'] . '</div>' : ''; ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php // Page thumbnail. if (!post_password_required() || has_post_thumbnail()) { echo '<div class="article_media">'; echo $post_data['media']; echo '</div>'; } ?> <div class="article_content textLight"> <?php the_content(); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'zn_framework') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?> </div><!-- .entry-content --> </article><!-- #post-## --> <div class="zn_blog_separator clearfix"></div>
if (have_posts()) { echo '<div class="row zn_portfolio_article_container ' . $zn_config['pagination'] . '">'; while (have_posts()) { the_post(); $posttags = get_the_terms(get_the_ID(), 'portfolio_categories'); $postTagsText = ''; $postTagsFilter = ''; if ($posttags) { foreach ($posttags as $tag) { $postTagsText .= $tag->name . ' / '; $postTagsFilter .= $tag->slug . ' '; } $postTagsText = rtrim($postTagsText, " / "); } $columns = isset($zn_config['columns']) ? $zn_config['columns'] : 'col-sm-4'; $image_size = zn_get_wp_image_size($columns, 1.37); if (has_post_thumbnail()) { if ($zn_config['use_as_gallery']) { //** This option can be set in portfolio_archive element $image = zn_get_post_image($post->ID, $image_size['width'], $image_size['height'], array('class' => 'img-responsive animate magPopupImg', 'data-mfp-src' => wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'thumbnail')))); } else { $image = zn_get_post_image($post->ID, $image_size['width'], $image_size['height'], array('class' => 'img-responsive animate')); } } echo '<article id="post-' . get_the_id() . '" class="' . $columns . ' text-center ' . implode(' ', get_post_class()) . '" data-filter="' . $postTagsFilter . '">'; ?> <?php if (isset($image)) { if ($zn_config['use_as_gallery']) { ?> <div class="scaleRotateImg portfolio_image"><?php