Exemplo n.º 1
0
function blox_parse_carousel_hook($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'post_type' => 'post', 'category' => '0', 'count' => '6', 'item_style' => 'default', 'overlay' => 'none', 'slideseconds' => 0, 'animation' => '', 'extra_class' => '', 'skin' => '', 'visibility' => ''), $atts));
    $visibility = str_replace(',', ' ', $visibility);
    $extra_class = $extra_class . ' ' . $visibility;
    global $post, $product, $woocommerce, $woocommerce_loop;
    global $the_query;
    $temp_post = $post;
    $temp_query = $the_query;
    $args = array('post_type' => $post_type, 'posts_per_page' => (int) $count, 'ignore_sticky_posts' => 1);
    if ($category != '' && $category != '0') {
        $taxonomies = get_object_taxonomies($post_type);
        $args['tax_query'] = array(array('taxonomy' => $taxonomies[0], 'terms' => $category));
    }
    $i = 0;
    $html = '';
    $title = $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : '';
    $the_query = new WP_Query($args);
    while ($the_query->have_posts()) {
        $the_query->the_post();
        if ($post_type == 'product') {
            $product = get_product(get_the_Id());
            ob_start();
            woocommerce_get_template_part('content', 'product');
            $html .= ob_get_clean();
        } else {
            $thumb = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
            $image = $thumb != '' ? blox_aq_resize($thumb, 400, 300, true) : '';
            $i++;
            $folio_arg = array('item_style' => $item_style, 'overlay' => $overlay, 'thumb' => $image, 'class' => 'col-md-3 col-sm-6 col-xs-12 swiper-slide', 'width' => '400', 'height' => '300');
            $html .= blox_loop_portfolio($folio_arg);
        }
    }
    $the_query = $temp_query;
    $post = $temp_post;
    $autoplay = 'data-duration="' . (int) $slideseconds * 1000 . '"';
    if ($post_type == 'product') {
        return "<div class='blox-element blox-carousel woocommerce swiper-container' {$autoplay}>\n                    {$title}\n                    <ul class='blox-element products swiper-wrapper'>\n                        " . $html . "\n                    </ul>\n                    <div class='carousel-control-prev'><i class='fa-angle-left'></i></div>\n                    <div class='carousel-control-next'><i class='fa-angle-right'></i></div>\n                </div>";
    }
    $skin = $item_style != 'alternative' ? $skin : '';
    return "<div class='blox-element blox-carousel swiper-container {$extra_class}' {$autoplay}>\n                {$title}\n                <div class='blox-element grid-loop portfolio swiper-wrapper {$skin}'>\n                    " . $html . "\n                </div>\n                <div class='carousel-control-prev'><i class='fa-angle-left'></i></div>\n                <div class='carousel-control-next'><i class='fa-angle-right'></i></div>\n            </div>";
}
Exemplo n.º 2
0
?>
				</a>
			</h1>
			<?php 
wp_nav_menu(array('menu' => 'global_menu', 'container' => 'div', 'container_class' => 'navbar navbar-inverse', 'container_id' => 'global-menu', 'menu_class' => 'nav navbar-nav'));
?>
		</header>
		<?php 
$cat_name = $page_id = '';
if (is_singular()) {
    if (is_single()) {
        $page_type = "post";
    } elseif (is_page()) {
        $page_type = "page";
    }
    $page_id = get_the_Id();
} elseif (is_archive()) {
    $page_type = "archive";
    $cat_name = get_the_category()[0]->cat_name;
} elseif (is_home()) {
    $page_type = "home";
} else {
    $page_type = "other";
}
?>
		<div id="container" class="container">
			<div class="row">
				<div id="content" <?php 
post_class('col-sm-8');
?>
					data-site-url="<?php 
    while (have_posts()) {
        the_post();
        ?>
				<div class="sixteen columns row divide notop">
					<h3 class="titledivider"><?php 
        the_title();
        ?>
</h3>
					<div class="dividerline"></div>
				</div>
				<div class="eleven columns row content left">
					<?php 
        //if(has_post_thumbnail(get_the_Id())){ echo '<div class="page-feature-image banner"><a href="'.get_the_permalink().'" title="'.get_the_title().'" >'; the_post_thumbnail('full-page-image');echo '</a></div>'; }
        ?>
					<?php 
        if (has_post_thumbnail(get_the_Id())) {
            echo '<div class="page-feature-image banner"><a href="' . get_the_permalink() . '" title="' . get_the_title() . '" >';
            the_post_thumbnail();
            echo '</a></div>';
        }
        ?>
					<div class="page-content"><?php 
        $pattern = "/<p[^>]*><\\/p[^>]*>/";
        echo preg_replace($pattern, '', get_the_content());
        ?>
</div>
				</div>
				<!-- Right Sidebar -->
				<?php 
        echo '<div class="four columns sidebar offset-by-one content">';
        get_template_part('sidebar');
Exemplo n.º 4
0
      <?php 
} elseif (is_page('43')) {
    ?>
      <?php 
    $gallery_id = get_post_meta(get_the_Id(), 'Gallery-ID', true);
    if (empty($gallery_id)) {
        $gallery_id = 4;
    }
    $content = "[smooth=id: " . $gallery_id . "; width:750; height:288; timed:true; arrows:true; carousel:false; links:false; info:true; align:center; frames:false; delay:9000; transition:fade; open:true; text:Pictures;]";
    smooth_show($content);
    ?>
      <?php 
} elseif (is_page('45')) {
    ?>
      <?php 
    $gallery_id = get_post_meta(get_the_Id(), 'Gallery-ID', true);
    if (empty($gallery_id)) {
        $gallery_id = 5;
    }
    $content = "[smooth=id: " . $gallery_id . "; width:750; height:288; timed:true; arrows:true; carousel:false; links:false; info:true; align:center; frames:false; delay:9000; transition:fade; open:true; text:Pictures;]";
    smooth_show($content);
    ?>
      <?php 
} else {
    ?>
      <?php 
    /*$gallery_id = get_post_meta(get_the_Id(), 'Gallery-ID', true); if(empty($gallery_id)) $gallery_id = 3;
    
    	$content = "[smooth=id: ".$gallery_id."; width:750; height:288; timed:true; arrows:true; carousel:false; links:false; info:true; align:center; frames:false; delay:9000; transition:fade; open:true; text:Pictures;]"; 
    
    	  smooth_show($content);