} echo presscore_get_post_media_slider($attachments_data, array('class' => $class, 'style' => $style)); break; case 'hovered_gallery': $class[] = 'rollover'; $gallery_args = array('class' => $class, 'style' => $style); if ('list' != $layout) { if ('wide' == $preview_mode && !$config->get('all_the_same_width')) { $target_image_width = $config->get('target_width') * 3; $gallery_args['title_img_options'] = array('w' => round($target_image_width), 'z' => 0, 'hd_convert' => false); } else { $target_image_width = $config->get('target_width') * 1.5; $gallery_args['title_img_options'] = array('w' => round($target_image_width), 'z' => 0); } } echo presscore_get_images_gallery_hoovered($attachments_data, $gallery_args); break; default: if ('normal' == $preview_mode) { $class[] = 'format-gallery-normal'; } echo presscore_get_images_gallery_1($attachments_data, array('class' => $class, 'style' => $style)); } } ?> </div> <div class="blog-content wf-td"> <h2 class="entry-title"> <a href="<?php the_permalink(); ?>
/** * @param string $class * @return string */ function presscore_mod_albums_get_preview_gallery($class = '') { $config = presscore_config(); // get gallery items $media_items = $config->get('post.media.library'); if (!$media_items) { $media_items = array(); } $open_post = 'post' == $config->get('post.open_as'); $exclude_cover = !$config->get('post.media.featured_image.enabled') && has_post_thumbnail(); // get gallery cover if (has_post_thumbnail()) { $gallery_cover = presscore_get_attachment_post_data(array(get_post_thumbnail_id())); // if ! exlude cover - prepend cover if (!$exclude_cover) { array_unshift($media_items, get_post_thumbnail_id()); } } else { if ($media_items) { $gallery_cover = presscore_get_attachment_post_data(array($media_items[0])); } else { $gallery_cover = array(); } } $gallery_cover = current($gallery_cover); if (post_password_required() || $open_post) { $media_items = array(); } $class .= ' rollover-click-target'; // If album lead to single post we need to display only one image if ($open_post) { $class .= ' go-to'; } // get attachments data $attachments_data = presscore_get_attachment_post_data($media_items); $gallery_args = array('class' => $class, 'exclude_cover' => $exclude_cover, 'title_img_options' => presscore_set_image_dimesions(), 'share_buttons' => true, 'attachments_count' => false, 'video_icon' => false, 'show_preview_on_hover' => false); // open album post instead lightbox gallery if ($open_post) { $gallery_args['title_image_args'] = array('href' => get_permalink(), 'class' => $class); } return presscore_get_images_gallery_hoovered($gallery_cover, $attachments_data, $gallery_args); }