Esempio n. 1
0
        ?>
			<?php 
        $slideshow = new THB_Collection($thb_page_id, 'work_slide');
        $slideshow->setSlidesImagesClickable();
        $slideshow->setSize('large');
        ?>

			<div class="single-work-slideshow-container">
			<?php 
        if (count($slideshow->getSlides()) > 0) {
            ?>
				<?php 
            if (thb_get_featured_image($thb_page_id) != '') {
                $slideshow->addCoverSlide(get_post_thumbnail_id($thb_page_id));
            }
            thb_get_template_part('config/modules/core/slideshows/submodules/flexslider/templates/slideshow', array('slideshow' => $slideshow, 'meta' => array('flexslider_smoothHeight' => '1', 'slideshowHeight' => '0', 'flexslider_effects' => 'fade', 'transition_speed' => 0.25, 'delay' => 4), 'id' => 'thb-single-work-slideshow'));
            ?>
			<?php 
        } else {
            ?>
				<?php 
            thb_post_format_image_markup(array('full' => thb_get_post_thumbnail_src($thb_page_id, 'full'), 'scaled' => thb_get_post_thumbnail_src($thb_page_id, 'large-cropped')));
            ?>
			<?php 
        }
        ?>
			</div>
		<?php 
    }
}
?>
Esempio n. 2
0
 function thb_featuredimagebackground()
 {
     $image_size = 'large';
     if (function_exists('is_woocommerce') && is_shop()) {
         $image = thb_get_option('woocommerce_shop_pageheader_background_image');
         thb_get_template_part('partial-featuredimage-background', array('featured_image' => thb_image_get_size($image['id'], $image_size), 'bg_opacity' => thb_get_option('woocommerce_shop_pageheader_background_opacity')));
     } elseif (function_exists('is_woocommerce') && is_product_category()) {
         global $wp_query;
         $cat = $wp_query->get_queried_object();
         $thumbnail_id = get_woocommerce_term_meta($cat->term_id, 'thumbnail_id', true);
         thb_get_template_part('partial-featuredimage-background', array('featured_image' => thb_image_get_size($thumbnail_id, $image_size), 'bg_opacity' => thb_get_option('woocommerce_shop_pageheader_background_opacity')));
     } else {
         $page_id = thb_get_page_ID();
         $is_dynamic_home = $page_id == 0 && is_front_page() && get_option('show_on_front') == 'posts';
         $image = '';
         $templates = array('default', 'single.php', 'single-product.php', 'single-works.php', 'template-archives.php', 'template-blog-classic.php', 'template-blog-stream.php', 'template-portfolio.php', 'template-contact.php', 'template-photogallery.php');
         if ($page_id !== 0 && !is_singular('works') && !is_attachment()) {
             $image = thb_get_featured_image($page_id, $image_size);
         }
         if (thb_check_page_template($page_id, $templates) || thb_is_archive() || is_attachment()) {
             thb_get_template_part('partial-featuredimage-background', array('featured_image' => $image, 'bg_opacity' => thb_get_post_meta(thb_get_page_ID(), 'background_opacity')));
         }
     }
 }