Ejemplo n.º 1
0
							<article class="span8 event-new"  id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class($class);
            ?>
><?php 
            $ids = get_metabox('gallery_image_ids');
            $video_embed = get_metabox('format_video_embed');
            $video_url = get_metabox('pretty_video_url');
            if (has_post_thumbnail($post->ID)) {
                if (!empty($video_url) && get_metabox('pretty_video') === 'true') {
                    events_image($width, $height, true, $video_url);
                } else {
                    events_image($width, $height);
                }
            } elseif ($ids != "false" && $ids != "") {
                portfolio_gallery($width, $height, $ids);
            } elseif (!empty($video_embed)) {
                echo apply_filters("the_content", htmlspecialchars_decode($video_embed));
            }
            ?>
							<?php 
            if ($format == 'link' || $format == 'quote') {
                ?>
									<div class="loop-block">                    
										<div class="loop-media">
											<div class="loop-format">
												<span class="post-format <?php 
                echo esc_attr($format);
Ejemplo n.º 2
0
    function shortcode_jw_recent_events($atts, $content)
    {
        global $portAtts;
        $hide_favorites = isset($atts['hide_favorites']) ? $atts['hide_favorites'] : 'false';
        $portAtts = $atts;
        $post_count = isset($atts['post_count']) ? $atts['post_count'] : '';
        $desc_title = !empty($atts['description_title']) ? $atts['description_title'] : '';
        $desc_text = !empty($atts['description_text']) ? $atts['description_text'] : '';
        $port_category_list = isset($atts['port_category_list']) ? $atts['port_category_list'] : '';
        // $arrow = '<div class="carousel-arrow jw-carrow">';
        //$arrow .= '<a class="carousel-prev" href="#"><i class="icon-long-arrow-left"></i></a>';
        //$arrow .= '<a class="carousel-next" href="#"><i class="icon-long-arrow-right"></i></a>';
        //$arrow .= '</div>';
        $output = '';
        //$output .= '<div class="jw-carousel-portfolio list_carousel">';
        $output .= '<div class="jw-carousel events">';
        $query = array('post_type' => 'jw_event', 'posts_per_page' => 4);
        $cats = explode(",", $port_category_list);
        if (!empty($cats[0])) {
            $query['tax_query'] = array(array('taxonomy' => 'cat_event', 'terms' => $cats, 'field' => 'id'));
        }
        if (!empty($atts['order'])) {
            switch ($atts['order']) {
                case "date_asc":
                    $query['orderby'] = 'date';
                    $query['order'] = 'ASC';
                    break;
                case "title_asc":
                    $query['orderby'] = 'title';
                    $query['order'] = 'ASC';
                    break;
                case "title_desc":
                    $query['orderby'] = 'title';
                    $query['order'] = 'DESC';
                    break;
                case "random":
                    $query['orderby'] = 'rand';
                    break;
            }
        }
        $imgwidth = 158;
        // START - LOOP
        query_posts($query);
        while (have_posts()) {
            the_post();
            global $post;
            $imgheight = $atts['image_height'];
            $likeit = get_post_meta($post->ID, 'post_likeit', true);
            $likecount = empty($likeit) ? '0' : $likeit;
            $likedclass = 'likeit';
            if (isset($_COOKIE['likeit-' . $post->ID])) {
                $likedclass .= ' liked';
            }
            $output .= '<div class="span6">';
            $ids = get_metabox('gallery_image_ids');
            $video_embed = get_metabox('format_video_embed');
            $video_url = get_metabox('pretty_video_url');
            ob_start();
            if (has_post_thumbnail($post->ID)) {
                if (!empty($video_url) && get_metabox('pretty_video') === 'true') {
                    events_image($imgwidth, $imgheight, true, $video_url);
                } else {
                    events_image($imgwidth, $imgheight);
                }
            } elseif ($ids != "false" && $ids != "") {
                portfolio_gallery($imgwidth, $imgheight, $ids);
            } elseif (!empty($video_embed)) {
                echo '<div class="carousel-video">';
                echo apply_filters("the_content", htmlspecialchars_decode($video_embed));
                echo '</div>';
            }
            if (!empty($jw_options['more_text'])) {
                $readMore = $jw_options['more_text'];
            } else {
                $readMore = jw_option('translate_readmore') ? jw_option('translate_readmore') : __('Read More', 'designinvento');
            }
            $output .= ob_get_clean();
            $output .= '<div class="even-content clearfix">';
            $output .= '<div class="span1 pull-left"><h3>' . get_metabox('event_date') . '</h3><p>' . get_metabox('event_month') . '</p></div>';
            $output .= '<div class="pull-left event-title"><h3>' . wp_trim_words(get_the_title(), 2) . '
						
						</h3><p class="event-loc"><i class="icon-time"></i> ' . get_metabox('event_time') . '<i class="icon-map-marker sec"></i> ' . get_metabox('location_name') . '</p>
						
						</div>';
            $output .= '<div class="">
						<div class="event-new-content"><p>' . wp_trim_words(get_the_content(), 18) . '</p></div>
						<div class="event-read"><a href="' . get_permalink() . '">' . wp_kses_post($readMore) . '</a></div>
						</div>';
            $output .= '</div>';
            $output .= '</div>';
        }
        wp_reset_query();
        // END   - LOOP
        $output .= '</div>';
        $output .= '<div class="clearfix"></div>';
        $output .= '</div>';
        if (!empty($desc_text)) {
            $output .= '</div>';
        }
        $output .= '</div>';
        return $output;
    }