<?php /** * @package WordPress * @subpackage WPEX WordPress Framework * Standard Post Format */ //load slider script wp_enqueue_script('flexslider-gallery-init', get_template_directory_uri() . '/js/flexslider-gallery-init.js', array('jquery', 'flexslider'), '1.0', true); //get img attachments $attachments = wpex_get_gallery_ids(); if ($attachments) { ?> <div class="flexslider-container single-post-slider"> <div id="slider-<?php echo get_the_ID(); ?> " class="flexslider flexslider-gallery"> <ul class="slides"> <?php // Loop through img attachments foreach ($attachments as $attachment) { $attachment_meta = wpex_get_attachment($attachment); ?> <li class="slide"> <?php if (wpex_gallery_is_lightbox_enabled() == 'on') { ?> <a href="<?php echo wp_get_attachment_url($attachment); ?>
/** * Portfolio single media template part * * @package Total WordPress theme * @subpackage Partials * @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Get portfolio video $video = wpex_get_portfolio_post_video(); // Get portfolio attachment ( gallery images ) $attachments = wpex_get_gallery_ids(get_the_ID()); // Get portfolio thumbnail $thumbnail = !$video ? wpex_get_portfolio_post_thumbnail() : ''; ?> <div id="portfolio-single-media" class="clr"> <?php // Display slider if there are $attachments if ($attachments) { get_template_part('partials/portfolio/portfolio-single-gallery'); // Display Post Video if defined } elseif ($video) { ?> <?php
function wpex_post_slider() { // Get gallery image ids $imgs = wpex_get_gallery_ids(); $lightbox_enabled = wpex_gallery_is_lightbox_enabled(); // Post vars global $post; $post_id = $post->ID; // No attachments, so do nothing if (!$imgs) { return; } ?> <div id="post-slider-wrap-<?php echo $post_id; ?> " class="post-slider-wrap clr flexslider-container"> <div id="post-slider-<?php echo $post_id; ?> " class="post-slider flexslider"> <ul class="slides clr"> <?php // Loop through each attachment ID foreach ($imgs as $img) { // Get image alt tag $img_url = wp_get_attachment_url($img); $cropped_img_url = wpex_get_featured_img_url($img); $img_alt = strip_tags(get_post_meta($img, '_wp_attachment_image_alt', true)); ?> <li> <?php // Display image with lightbox if ($lightbox_enabled == 'on') { ?> <a href="<?php echo $img_url; ?> " title="<?php echo $img_alt; ?> " rel="wpexLightboxGallery[]" class="wpex-lightbox-gallery"> <img src="<?php echo $cropped_img_url; ?> " alt="<?php echo $img_alt; ?> " /> </a> <?php } else { // Lightbox is disabled, only show image ?> <img src="<?php echo $cropped_img_url; ?> " alt="<?php echo $img_alt; ?> " /> <?php } ?> </li> <?php } ?> </ul><!-- .slides --> </div><!-- #post-slider .flexslider --> </div><!-- #post-slider-wrap --> <?php }
* @package Total WordPress Theme * @subpackage VC Templates * @version 3.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Not needed in admin ever if (is_admin()) { return; } // Get and extract shortcode attributes extract(vc_map_get_attributes($this->getShortcode(), $atts)); // Set image ids $image_ids = 'true' == $post_gallery ? wpex_get_gallery_ids() : $image_ids; // If there aren't any images lets display a notice if (empty($image_ids)) { return; } else { // Get image ID's if (!is_array($image_ids)) { $attachment_ids = explode(',', $image_ids); } else { $attachment_ids = $image_ids; } } // Remove duplicate images $attachment_ids = array_unique($attachment_ids); // Turn links into array if ($custom_links) {
function wpex_gallery_count() { $ids = wpex_get_gallery_ids(); return count($ids); }
* @version 3.3.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Not needed in admin ever if (is_admin()) { return; } // Get and extract shortcode attributes $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); // Get images from post gallery if ('true' == $post_gallery) { $image_ids = wpex_get_gallery_ids(); } // If there aren't any images return if (empty($image_ids)) { return; } else { // Get image ID's if (!is_array($image_ids)) { $attachment_ids = explode(',', $image_ids); } else { $attachment_ids = $image_ids; } } // Lets do some things now that we have images if (!empty($attachment_ids)) { // Declare vars
* @link http://www.wpexplorer.com * @since Total 1.6.0 * @version 1.0.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Return if there isn't any thumbnail if (!has_post_thumbnail()) { return; } // Get post id $post_id = get_the_ID(); // Get attachments $attachments = wpex_get_gallery_ids($post_id); // Return standard entry style if password protected or there aren't any attachments if (post_password_required($post_id) || empty($attachments)) { get_template_part('partials/blog/media/blog-entry', 'thumbnail'); return; } ?> <div class="blog-entry-media clr"> <div class="gallery-format-post-slider-wrap clr"> <div class="gallery-format-post-slider flexslider-container"> <div class="flexslider"> <ul class="slides <?php if (wpex_gallery_is_lightbox_enabled() == 'on') { echo 'lightbox-group'; }
if ('true' == $entry_media) { /* Video -------------------------------------------------------------------------------*/ if ('true' == $featured_video && $post->video_output) { ?> <div class="portfolio-entry-media portfolio-featured-video entry-media wpex-clr"> <?php echo $post->video_output; ?> </div><!-- .portfolio-featured-video --> <?php /* Gallery: Still not sure if I am going to add this or not...too much bloat :( -------------------------------------------------------------------------------*/ } elseif ('true' == $gallery_slider && ($gallery_attachments = wpex_get_gallery_ids($post->ID))) { // Get only first x number of items $gallery_attachments = array_slice($gallery_attachments, 0, 3); // Slider args adds a filter so you can easily tweak the slider animation, etc for this slider $args = array('filter_tag' => 'vcex_portfolio_grid_slider_' . $unique_id, 'fade' => 'true', 'height-animation-duration' => '0.0'); ?> <div class="vcex-grid-entry-slider wpex-slider slider-pro clr"<?php wpex_slider_data($args); ?> > <div class="wpex-slider-slides sp-slides <?php if ('lightbox' == $thumb_link) { echo 'lightbox-group'; }