Esempio n. 1
0
" title="<?php 
            echo $attachment_meta['alt'];
            ?>
" class="fancybox" rel="wpexLightboxGallery">
							<?php 
        }
        ?>
							<img id="post-thumbnail" src="<?php 
        echo aq_resize(wp_get_attachment_url($attachment), wpex_img_size('post', 'width'), wpex_img_size('post', 'height'), wpex_img_size('post', 'crop'));
        ?>
" alt="<?php 
        echo the_title();
        ?>
" />
							<?php 
        if (wpex_gallery_is_lightbox_enabled() == 'on') {
            ?>
								</a>
							<?php 
        }
        ?>
							<?php 
        if ($attachment_meta['description']) {
            ?>
								<div class="single-post-slider-caption clearfix">
									<?php 
            echo $attachment_meta['description'];
            ?>
								</div>
							<?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 
    }
Esempio n. 3
0
	<div class="post-slider flexslider">

		<ul class="slides clr wpex-lightbox-gallery">

			<?php 
// Loop through each attachment ID
foreach ($attachments as $attachment) {
    $img_url = wp_get_attachment_url($attachment);
    $img_alt = get_post_meta($attachment, '_wp_attachment_image_alt', true);
    $img_html = wp_get_attachment_image($attachment, 'wpex-portfolio-post');
    ?>
				<li>
					<?php 
    // Display image with lightbox
    if ('on' == wpex_gallery_is_lightbox_enabled()) {
        ?>
						<a href="<?php 
        echo $img_url;
        ?>
" title="<?php 
        echo $img_alt;
        ?>
" class="wpex-lightbox-item">
							<?php 
        echo $img_html;
        ?>
						</a>
					<?php 
        // Lightbox is disabled, only show image
    } else {
Esempio n. 4
0
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Get attachments
$attachments = wpex_get_gallery_ids(get_the_ID());
// Return standard entry style if password protected or there aren't any attachments
if (post_password_required() || empty($attachments)) {
    get_template_part('partials/blog/media/blog-entry');
    return;
}
// Check if lightbox is enabled
if (wpex_gallery_is_lightbox_enabled() || wpex_get_mod('blog_post_image_lightbox')) {
    $lightbox_enabled = true;
    wpex_enqueue_ilightbox_skin();
    // Load lightbox skin stylesheet
} else {
    $lightbox_enabled = false;
}
?>

<div id="post-media" class="clr">

    <div class="gallery-format-post-slider">

        <div class="wpex-slider-preloaderimg">
            <?php 
// Display first image as a placeholder while the others load
<?php

/**
 * Used to display the portfolio slider
 *
 * @package Total WordPress Theme
 * @subpackage Partials
 * @version 3.3.0
 */
// Get attachments
$attachments = wpex_get_gallery_ids(get_the_ID());
// Check if lightbox is enabled
$lightbox_enabled = wpex_gallery_is_lightbox_enabled() ? true : false;
// Load lightbox skin stylesheet
if ($lightbox_enabled) {
    wpex_enqueue_ilightbox_skin();
}
/**
 * Slider args
 *
 * You can easily tweak your slider via a child theme using the wpex_portfolio_single_gallery filter
 * defined below in the args attribute. Please referance the theme docs for more info
 */
$slider_data_args = array('filter_tag' => 'wpex_portfolio_single_gallery');
?>

<div id="portfolio-single-gallery" class="portfolio-post-slider wpex-clr">

	<div class="wpex-slider-preloaderimg">
		<?php 
// Display first image as a placeholder while the others load