Exemplo n.º 1
0
function render_portfolio_carousel($postspp, $title, $cats = '')
{
    $out = '';
    $arr = array('posts_per_page' => $postspp, 'post_type' => 'portfolio', 'ignore_sticky_posts' => true);
    if (!empty($cats)) {
        $tax_query_arr = array('taxonomy' => 'cws-portfolio-type', 'field' => 'slug', 'terms' => explode(',', $cats));
        $arr['tax_query'] = array($tax_query_arr);
    }
    $r = new WP_Query($arr);
    $out .= "<div class='carousel_header clearfix'>";
    $out .= $r->post_count ? "<div class='carousel_nav'><i class='prev fa fa-angle-left'></i><i class='next fa fa-angle-right'></i><div class='clearfix'></div></div>" : "";
    $out .= !empty($title) ? "<div class='widget-title'>{$title}</div>" : "";
    $out .= "</div>";
    $out .= "<div class='photo_tour carousel_content'>";
    $out .= "<div class='carousel'>";
    $thumbnail_dims = cws_get_post_tmumbnail_dims('pinterest', 2, 'none');
    $chars_count = cws_get_content_chars_count('pinterest', 4);
    while ($r->have_posts()) {
        $r->the_post();
        $out .= build_portfolio_item(get_the_ID(), 4, true, $thumbnail_dims, $chars_count);
    }
    $out .= "</div></div>";
    return $out;
}
Exemplo n.º 2
0
    }
    ?>
		<?php 
}
?>
	</a>
</h2>
<?php 
do_action('tribe_events_after_the_event_title');
?>

<!-- Event Image -->
<?php 
$image = tribe_event_featured_image();
$r = preg_match("/<img.*src=\"([^\"]+)/", $image, $matches);
$dims = cws_get_post_tmumbnail_dims("medium", null, null);
$url = isset($matches[1]) ? $matches[1] : "";
$bfi_url = bfi_thumb($url, array('width' => $dims['width'], 'height' => $dims['height']));
echo str_replace($url, $bfi_url, $image);
?>

<!-- Event Content -->
<?php 
do_action('tribe_events_before_the_content');
?>
<div class="tribe-events-list-event-description tribe-events-content description entry-summary">
	<?php 
the_excerpt();
?>
</div><!-- .tribe-events-list-event-description -->
Exemplo n.º 3
0
function cws_output_media_part($blogtype, $pinterest_layout, $sb_block, $post = null)
{
    $pid = $post ? $post->ID : get_the_id();
    $post_format = get_post_format($pid);
    $media_meta = get_post_meta($pid, 'cws-mb');
    $media_meta = isset($media_meta[0]) ? $media_meta[0] : null;
    $thumbnail = has_post_thumbnail($pid) ? wp_get_attachment_image_src(get_post_thumbnail_id($pid), 'full') : null;
    $thumbnail = $thumbnail ? $thumbnail[0] : null;
    $single = isset($post) && $post_format != 'gallery' ? true : false;
    $thumbnail_dims = cws_get_post_tmumbnail_dims($blogtype, $pinterest_layout, $sb_block, $single);
    $some_media = false;
    ob_start();
    ?>
			<div class="wrapper">
				<?php 
    switch ($post_format) {
        case 'link':
            $link = $media_meta["cws-mb-link"];
            if ($thumbnail) {
                ?>
								<div class="pic">
									<img src="<?php 
                echo bfi_thumb($thumbnail, $thumbnail_dims);
                $some_media = true;
                ?>
" alt />
									<div class="hover-effect"></div>
									<?php 
                echo $link ? "<div class='links'><a href='{$link}' class='fa fa-link' title='{$link}'></a></div>" : "<div class='links'><a href='{$thumbnail}' class='fancy fa fa-eye'></a></div>";
                ?>
								</div>
								<?php 
            } else {
                echo $link ? "<div class='link_url'>{$link}</div>" : "";
            }
            $some_media = true;
            break;
        case 'video':
            if ($media_meta['cws-mb-video']) {
                echo "<div class='video'>" . apply_filters('the_content', "[embed width='" . $thumbnail_dims['width'] . "']" . $media_meta['cws-mb-video'] . "[/embed]") . "</div>";
                $some_media = true;
            }
            break;
        case 'audio':
            if ($media_meta['cws-mb-audio']) {
                echo "<div class='audio'>" . apply_filters('the_content', '[audio mp3="' . $media_meta['cws-mb-audio'] . '"]') . "</div>";
                $some_media = true;
            }
            break;
        case 'quote':
            if ($media_meta["cws-mb-quote"]) {
                $text = $media_meta["cws-mb-quote"];
                $author = $media_meta["cws-mb-quote-author"];
                echo cws_testimonial_renderer($thumbnail, $text, $author);
                $some_media = true;
            }
            break;
        case 'gallery':
            if ($media_meta["cws-mb-gallery"]) {
                $gallery = $media_meta["cws-mb-gallery"];
                $match = preg_match_all("/\\d+/", $gallery, $images);
                if ($match) {
                    $images = $images[0];
                    $image_srcs = array();
                    foreach ($images as $image) {
                        $image_src = wp_get_attachment_image_src($image, 'full');
                        $image_url = $image_src[0];
                        array_push($image_srcs, $image_url);
                    }
                    $some_media = count($image_srcs) > 0 ? true : false;
                    $carousel = count($image_srcs) > 1 ? true : false;
                    $gallery_id = uniqid('cws-gallery-');
                    echo $carousel ? "<div class='gallery_carousel_nav'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class='prev fa fa-angle-left'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class='next fa fa-angle-right'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='clearfix'></div></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='gallery_post_carousel'>" : "";
                    foreach ($image_srcs as $image_src) {
                        ?>
										<div class='pic'>
											<img src="<?php 
                        echo bfi_thumb($image_src, $thumbnail_dims);
                        ?>
" alt />
											<div class="hover-effect"></div>
											<div class="links">
												<a href="<?php 
                        echo $image_src;
                        ?>
" <?php 
                        echo $carousel ? " data-fancybox-group='{$gallery_id}'" : "";
                        ?>
 class="<?php 
                        echo $carousel ? 'fancy fancy_gallery fa fa-photo' : 'fancy fa fa-eye';
                        ?>
" <?php 
                        echo $carousel ? "data-thumbnail='" . bfi_thumb($image_src, array('width' => 50, 'height' => 50, 'crop' => true)) . "'" : "";
                        ?>
></a>
											</div>
										</div>
										<?php 
                    }
                    echo $carousel ? "</div>" : "";
                }
            }
            break;
        default:
            if ($thumbnail) {
                echo "<div class='pic'><img src='" . bfi_thumb($thumbnail, $thumbnail_dims) . "' alt /><div class='hover-effect'></div><div class='links'><a class='fancy fa fa-eye' href='{$thumbnail}'></a></div></div>";
                $some_media = true;
            }
            break;
    }
    ?>
			</div>
		<?php 
    $some_media ? ob_end_flush() : ob_end_clean();
}
Exemplo n.º 4
0
?>
" rel="bookmark">
			<?php 
the_title();
?>
		</a>
	</h2>
	<?php 
do_action('tribe_events_after_the_event_title');
?>

	<!-- Event Image -->
	<?php 
$image = tribe_event_featured_image();
$r = preg_match("/<img.*src=\"([^\"]+)/", $image, $matches);
$dims = cws_get_post_tmumbnail_dims("pinterest", 4, null);
$url = isset($matches[1]) ? $matches[1] : "";
$bfi_url = bfi_thumb($url, array('width' => $dims['width'], 'height' => $dims['height']));
echo str_replace($url, $bfi_url, $image);
?>

	<!-- Event Content -->
	<?php 
do_action('tribe_events_before_the_content');
?>
	<div class="tribe-events-list-photo-description tribe-events-content entry-summary description">
		<?php 
echo tribe_events_get_the_excerpt();
?>
	</div>
	<?php 
Exemplo n.º 5
0
?>
" rel="bookmark">
		<?php 
the_title();
?>
	</a>
</h2>
<?php 
do_action('tribe_events_after_the_event_title');
?>

<!-- Event Image -->
<?php 
$image = tribe_event_featured_image();
$r = preg_match("/<img.*src=\"([^\"]+)/", $image, $matches);
$dims = cws_get_post_tmumbnail_dims("large", null, null);
$url = $matches[1];
$bfi_url = bfi_thumb($url, array('width' => $dims['width'], 'height' => $dims['height']));
echo str_replace($url, $bfi_url, $image);
?>

<!-- Event Content -->
<?php 
do_action('tribe_events_before_the_content');
?>
<div class="tribe-events-list-event-description tribe-events-content description entry-summary">
	<?php 
echo tribe_events_get_the_excerpt();
?>
	<a href="<?php 
echo tribe_get_event_link();