Пример #1
0
?>
</h4>
        </div>
        <div class="nicdark_focus nicdark_bg_orange">
            <div class="nicdark_bg_orangedark nicdark_focus nicdark_padding1020 nicdark_sizing nicdark_width_percentage50">
                <p class="white"><i class="icon-user"></i> <?php 
echo get_the_author();
?>
</p>
            </div>
            <div class="nicdark_focus nicdark_padding1020 nicdark_sizing nicdark_width_percentage50">
                <p class="white"><i class="icon-chat"></i> No Comments</p>
            </div>
        </div>

        <div class="nicdark_focus nicdark_border_grey nicdark_sizing nicdark_padding20">
            <p><?php 
custom_excerpt('maxchar=350');
?>
</p>
            <div class="nicdark_space20"></div>
            <a class="nicdark_btn nicdark_press nicdark_bg_orange white medium uppercase" href="<?php 
echo get_the_permalink();
?>
">Подробнее</a>
        </div>
    </div>

</div>

    $event_slug = $event->post_name;
    $event_search_term = get_query_var('project-event');
    if (!$event_search_term || $event_slug == $event_search_term) {
        $found_projects = true;
        ?>
<li>
  <div class="box-content">
    <h4><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
    <?php 
        custom_excerpt(30);
        ?>
    <footer>
      <?php 
        if ($challenge !== '0' && !empty($challenge->post_title) || !empty($challenge_other)) {
            ?>
          <h5>Challenge</h5>
          <?php 
            if ($challenge !== '0' && !empty($challenge->post_title)) {
                ?>
            <p><?php 
                echo $challenge->post_title;
                ?>
</p>
          <?php 
            } else {
Пример #3
0
</small></a>

                <div class="nicdark_displaynone_responsive nicdark_width_percentage40 nicdark_focus">
                    <div class="nicdark_space1"></div>
                </div>

                <div class="nicdark_width100_responsive nicdark_width_percentage60 nicdark_float_right nicdark_bg_white nicdark_border_grey nicdark_sizing">
                    <div class="nicdark_textevidence nicdark_bg_grey nicdark_borderbottom_grey">
                        <h4 class="grey nicdark_margin20"><?php 
echo get_the_title();
?>
</h4>
                    </div>
                    <div class="nicdark_margin20">
                        <p><?php 
custom_excerpt('maxchar=100');
?>
</p>
                  
                        <div class="nicdark_space20"></div>
                        <a class="nicdark_btn nicdark_press nicdark_bg_blue white small uppercase" href="<?php 
echo get_the_permalink();
?>
">Подробнее</a>
                    </div>
                </div>

            </div>
            <!--end preview-->

Пример #4
0
        echo '<img src=' . get_template_directory_uri() . '/images/fallback/' . $other_thumb . '.gif alt="No Image Avaliable">';
    }
    ?>
                        </a>   
                    </div>
                    <div class="post-container">
                        <h2 class="post-title"><a href="<?php 
    the_permalink();
    ?>
" rel="bookmark"><?php 
    the_title();
    ?>
</a></h2>
                        <div class="post-excerpt">
                            <?php 
    custom_excerpt($excerpt_length);
    ?>
                        </div>
                    </div>
                    <div class="post-meta">
                        <span class="comments"><?php 
    comments_popup_link('0', '1', '%', '', '');
    ?>
</span>
                        <span class="author"><?php 
    the_author_posts_link();
    ?>
</span>
						<span class="pdate"><a href="<?php 
    the_permalink();
    ?>
Пример #5
0
function get_posts_slider()
{
    global $post, $wp_query;
    $output = '';
    $options = get_option('sf_flexform_options');
    $posts_slider_type = get_post_meta($post->ID, 'sf_posts_slider_type', true);
    $posts_category = get_post_meta($post->ID, 'sf_posts_slider_category', true);
    $portfolio_category = get_post_meta($post->ID, 'sf_posts_slider_portfolio_category', true);
    $count = get_post_meta($post->ID, 'sf_posts_slider_count', true);
    $args = array();
    if ($posts_slider_type == "post") {
        $category_list = get_category_list('category');
        $slider_category = $category_list[$posts_category];
        if ($slider_category == "All") {
            $slider_category = "all";
        }
        if ($slider_category == "all") {
            $slider_category = '';
        }
        $category_slug = str_replace('_', '-', $slider_category);
        $args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $count);
    } else {
        if ($posts_slider_type == "hybrid") {
            $args = array('post_type' => array('post', 'portfolio'), 'post_status' => 'publish', 'posts_per_page' => $count);
        } else {
            $category_list = get_category_list('portfolio-category');
            $slider_category = $category_list[$portfolio_category];
            if ($slider_category == "All") {
                $slider_category = "all";
            }
            if ($slider_category == "all") {
                $slider_category = '';
            }
            $category_slug = str_replace('_', '-', $slider_category);
            $args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $category_slug, 'posts_per_page' => $count);
        }
    }
    $slider_items = new WP_Query($args);
    if ($slider_items->have_posts()) {
        $output .= '<!--// SWIFT SLIDER //-->' . "\n";
        $output .= '<div id="swift-slider" class="flexslider">' . "\n";
        $output .= '<div class="swift-slider-loading"></div>' . "\n";
        $output .= '<ul class="slides">' . "\n";
        while ($slider_items->have_posts()) {
            $slider_items->the_post();
            $post_title = get_the_title();
            $post_permalink = get_permalink();
            $post_author = get_the_author_link();
            $post_date = get_the_date();
            $post_client = get_post_meta($post->ID, 'sf_portfolio_client', true);
            $post_categories = get_the_category_list(', ');
            if ($posts_slider_type == "portfolio") {
                $post_categories = get_the_term_list($post->ID, 'portfolio-category', '', ', ');
            }
            $post_comments = get_comments_number();
            $custom_excerpt = get_post_meta($post->ID, 'sf_custom_excerpt', true);
            $post_excerpt = '';
            if ($custom_excerpt != '') {
                $post_excerpt = custom_excerpt($custom_excerpt, 20);
            } else {
                $post_excerpt = excerpt(20);
            }
            $posts_slider_image = rwmb_meta('sf_posts_slider_image', 'type=image&size=full');
            $caption_position = get_post_meta($post->ID, 'sf_caption_position', true);
            $accent_color = get_option('accent_color', '#fb3c2d');
            $secondary_accent_color = get_option('secondary_accent_color', '#2e2e36');
            $secondary_accent_alt_color = get_option('secondary_accent_alt_color', '#ffffff');
            $media_image_url = "";
            foreach ($posts_slider_image as $detail_image) {
                $media_image_url = $detail_image['url'];
                break;
            }
            if (!$posts_slider_image) {
                $posts_slider_image = get_post_thumbnail_id();
                $media_image_url = wp_get_attachment_url($posts_slider_image, 'full');
            }
            if (!$caption_position) {
                $caption_position = "caption-right";
            }
            $image = aq_resize($media_image_url, 1920, NULL, true, false);
            $output .= '<li>' . "\n";
            $output .= '<div class="slide-caption-container">' . "\n";
            if ($image) {
                $output .= '<div class="flex-caption ' . $caption_position . '">' . "\n";
                $output .= '<div class="flex-caption-details">' . "\n";
                $output .= '<div class="caption-details-inner">' . "\n";
                $output .= '<div class="details clearfix">' . "\n";
                $output .= '<span class="date">' . $post_date . '</span>' . "\n";
                if ($post_client != "") {
                    $output .= '<span class="item-client">' . __("Client: ", "swiftframework") . $post_client . '</span>' . "\n";
                    $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n";
                } else {
                    $output .= '<span class="item-author">' . __("Posted by ", "swiftframework") . $post_author . '</span>' . "\n";
                    $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n";
                }
                $output .= '</div>';
                if (comments_open()) {
                    $output .= '<div class="comment-chart chart" data-percent="1" data-count="' . $post_comments . '" data-barcolor="' . $secondary_accent_color . '"><span>0</span><i class="icon-comments"></i></div>' . "\n";
                }
                if (function_exists('lip_get_love_count')) {
                    $output .= '<div class="loveit-chart chart" data-percent="1" data-count="' . lip_get_love_count($post->ID) . '" data-barcolor="' . $accent_color . '"><span>0</span><i class="icon-heart"></i></div>' . "\n";
                }
                $output .= '</div>' . "\n";
                $output .= '</div>' . "\n";
                $output .= '<div class="flex-caption-headline clearfix">' . "\n";
                $output .= '<h4><a href="' . $post_permalink . '"><span>' . $post_title . '</span><i class="icon-angle-right"></i></a></h4>' . "\n";
                $output .= '</div></div></div>' . "\n";
                $output .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $post_title . '" />' . "\n";
            } else {
                $output .= '<div class="flex-caption-large clearfix">' . "\n";
                $output .= '<h1><a href="' . $post_permalink . '">' . $post_title . '</a></h1>' . "\n";
                $output .= '<div class="excerpt">' . $post_excerpt . '</div>' . "\n";
                $output .= '<div class="cl-charts">' . "\n";
                if (comments_open()) {
                    $output .= '<div class="comment-chart fw-chart chart" data-percent="1" data-count="' . $post_comments . '" data-barcolor="' . $secondary_accent_alt_color . '"><span>0</span><i class="icon-comments"></i></div>' . "\n";
                }
                if (function_exists('lip_get_love_count')) {
                    $output .= '<div class="loveit-chart fw-chart chart" data-percent="1" data-count="' . lip_get_love_count($post->ID) . '" data-barcolor="' . $accent_color . '"><span>0</span><i class="icon-heart"></i></div>' . "\n";
                }
                $output .= '</div>' . "\n";
                $output .= '<div class="details clearfix">' . "\n";
                $output .= '<span class="date">' . $post_date . '</span>' . "\n";
                if ($post_client != "") {
                    $output .= '<span class="item-client">' . __("Client: ", "swiftframework") . $post_client . '</span>' . "\n";
                    $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n";
                } else {
                    $output .= '<span class="item-author">' . __("Posted by ", "swiftframework") . $post_author . '</span>' . "\n";
                    $output .= '<span class="item-categories">' . $post_categories . '</span>' . "\n";
                }
                $output .= '</div></div></div>' . "\n";
            }
            $output .= '</li>' . "\n";
        }
        wp_reset_postdata();
        $output .= '</ul></div>' . "\n";
    }
    echo $output;
}
    function widget($args, $instance)
    {
        extract($args);
        global $post;
        $title = $instance['title'];
        $post_type = $instance['post_type'];
        $categories = $instance['categories'];
        $posts = $instance['posts'];
        $gallery = $instance['gallery'];
        $orderby = $instance['orderby'];
        $order = $instance['order'];
        echo $before_widget;
        ?>
		<?php 
        $recent_posts = new WP_Query(array('posts_per_page' => $posts, 'cat' => $categories, 'ignore_sticky_posts' => 1, 'orderby' => $orderby, 'order' => $order));
        if ($recent_posts->found_posts >= 3) {
            ?>
		<div class="clearfix <?php 
            if ($gallery) {
                echo 'mb25';
            } else {
                echo 'mb10';
            }
            ?>
 oh">
			<h4 class="cat-title cat-icon"><a href="<?php 
            echo get_category_link($categories);
            ?>
"><?php 
            echo $title;
            ?>
</a></h4>
			
			<div class="carousel-container">
				<div class="carousel-navigation">
					<a class="carousel-prev"></a>
					<a class="carousel-next"></a>
                </div>
			
				<div class="carousel-item-holder row" data-index="0">

						<?php 
            $post_types = get_post_types();
            unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);
            if ($post_type == 'all') {
                $post_type_array = $post_types;
            } else {
                $post_type_array = $post_type;
            }
            if ($categories != 'all') {
                $categories_array = array($categories);
            }
            ?>
						
						<?php 
            while ($recent_posts->have_posts()) {
                $recent_posts->the_post();
                ?>
					<div class="four column carousel-item">
                    	<div class="carousel-images">
							<?php 
                $post_format = get_post_format();
                if (has_post_format('video') || has_post_format('gallery') || has_post_format('audio')) {
                    echo '<div class="carousel-icons">';
                    echo '<a href="' . esc_url(get_post_format_link($post_format)) . '">';
                    echo '<span title="' . get_post_format_string($post_format) . '" class="has-tip format-icon ' . $post_format . '-ico"></span>';
                    echo '</a>';
                    echo '</div>';
                }
                ?>
                            <a href="<?php 
                the_permalink();
                ?>
" rel="bookmark" title="<?php 
                the_title();
                ?>
">
								<?php 
                // Post Thumbnail
                if (has_post_thumbnail()) {
                    the_post_thumbnail('carousel-thumb');
                } else {
                    echo '<img src=' . get_template_directory_uri() . '/images/fallback/carousel-thumb.gif alt="No Image Avaliable">';
                }
                ?>
                            </a>
                        </div>		
						<?php 
                if (!$gallery) {
                    ?>
                        <div class="post-container">
                        	<h2 class="post-title"><a href='<?php 
                    the_permalink();
                    ?>
' title='<?php 
                    the_title();
                    ?>
'><?php 
                    the_title();
                    ?>
</a></h2>
                            <div class="post-content"><p><?php 
                    custom_excerpt('25');
                    ?>
</p></div>
                        </div>
                        <div class="post-meta">
	                        <?php 
                    if (!post_password_required() && (comments_open() || get_comments_number())) {
                        ?>
                        	<span class="comments"><a href="#"><?php 
                        comments_popup_link('0', '1', '%', '', '');
                        ?>
</a></span>
                            <?php 
                    }
                    ?>
    						<span class="pdate"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_time('F j, Y');
                    ?>
</a></span>

                        </div>
						<?php 
                }
                ?>
                    </div>
						
						<?php 
            }
            ?>

				</div>
			</div>
		</div>
		<?php 
        }
        ?>
		<?php 
        echo $after_widget;
    }
Пример #7
0
        the_post();
        ?>
			<div class="">
            	<div class="">
                    <h2><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
                    <?php 
        custom_excerpt(70);
        ?>
                    <a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
" class="btn"><?php 
        _e('Read more', 'ieseg2015');
        ?>
</a>
                </div>
            </div>
<?php 
    }
        } else {
            $length = 42;
        }
        ?>
        <div class="box-content">
          <h4><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
          
          <div class="solution-excerpt">
            <?php 
        custom_excerpt($length);
        ?>
          </div>

          <div class="solution-meta">
            <h3>Challenge</h3>
            <p><strong><?php 
        echo $challengeName->post_title;
        ?>
</strong></p>

            <h3>Event</h3>
            <p><strong><?php 
        echo $eventName->post_title;
        ?>
</strong></p>
Пример #9
0
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $items = $item_figure = $el_position = '';
     extract(shortcode_atts(array('title' => '', "pagination" => "no", "blog_type" => "standard", "excerpt_length" => '20', "item_count" => '5', "category" => '', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // BLOG QUERY SETUP
     global $post, $wp_query;
     if (get_query_var('paged')) {
         $paged = get_query_var('paged');
     } elseif (get_query_var('page')) {
         $paged = get_query_var('page');
     } else {
         $paged = 1;
     }
     $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'category_name' => $category_slug, 'posts_per_page' => $item_count);
     $blog_items = new WP_Query($blog_args);
     $list_class = '';
     if ($blog_type == "masonry") {
         $list_class .= 'masonry-items';
     } else {
         if ($blog_type == "mini") {
             $list_class .= 'mini-items';
         } else {
             $list_class .= 'standard-items';
         }
     }
     $items .= '<ul class="blog-items ' . $list_class . ' clearfix">';
     while ($blog_items->have_posts()) {
         $blog_items->the_post();
         $post_format = get_post_format();
         $post_title = get_the_title();
         $post_author = get_the_author_link();
         $post_date = get_the_date();
         $post_categories = get_the_category_list(', ');
         $post_comments = get_comments_number();
         $post_permalink = get_permalink();
         $custom_excerpt = get_post_meta($post->ID, 'coope_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = excerpt($excerpt_length);
         }
         $sidebar_config = get_post_meta($post->ID, 'coope_sidebar_config', true);
         $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = '';
         if ($blog_type == "mini") {
             if ($sidebar_config == "no-sidebars") {
                 $thumb_width = 446;
                 $thumb_height = NULL;
                 $video_height = 250;
             } else {
                 $thumb_width = 290;
                 $thumb_height = NULL;
                 $video_height = 163;
             }
         } else {
             $thumb_width = 640;
             $thumb_height = NULL;
             $video_height = 360;
             $bordered_thumb_width = 408;
             $bordered_thumb_height = 303;
             $bordered_video_height = 303;
         }
         $thumb_type = get_post_meta($post->ID, 'coope_thumbnail_type', true);
         $thumb_image = rwmb_meta('coope_thumbnail_image', 'type=image&size=full');
         $thumb_video = get_post_meta($post->ID, 'coope_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('coope_thumbnail_gallery', 'type=image&size=blog-image');
         $thumb_link_type = get_post_meta($post->ID, 'coope_thumbnail_link_type', true);
         $thumb_link_url = get_post_meta($post->ID, 'coope_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('coope_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('coope_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = get_post_meta($post->ID, 'coope_thumbnail_link_video_url', true);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         // LINK TYPE VARIABLES
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="view"';
                     $item_icon = "search";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                         $item_icon = "search";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'href="' . $thumb_lightbox_video_url . '" class="fancybox-media"';
                             $item_icon = "facetime-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "file";
                         }
                     }
                 }
             }
         }
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "none") {
             $item_figure .= '<div class="spacer"></div>';
         } else {
             $item_figure .= '<figure>';
             if ($thumb_type == "video") {
                 $video = video_embed($thumb_video, $thumb_width, $video_height);
                 $item_figure .= $video;
             } else {
                 if ($thumb_type == "slider") {
                     $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
                     foreach ($thumb_gallery as $image) {
                         $item_figure .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>";
                     }
                     $item_figure .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>';
                 } else {
                     if ($thumb_type == "image") {
                         $image = aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                         if ($image) {
                             $item_figure .= '<a ' . $link_config . '>';
                             if ($blog_type == "masonry") {
                                 $item_figure .= '<div class="overlay"><div class="thumb-info">';
                                 $item_figure .= '<i class="icon-' . $item_icon . '"></i>';
                                 $item_figure .= '</div></div>';
                             }
                             $item_figure .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />';
                             $item_figure .= '</a>';
                         }
                     }
                 }
             }
             $item_figure .= '</figure>';
         }
         // BLOG ITEM OUTPUT
         $items .= '<li class="blog-item">';
         if ($blog_type == "masonry") {
             $items .= $item_figure;
             $item_figure = '';
             $items .= '<div class="blog-details-wrap">';
             $items .= '<h4><a href="' . $post_permalink . '">' . $post_title . '</a></h4>';
             $items .= '<div class="blog-item-details clearfix">' . sprintf(__('By <a href="%2$s">%1$s</a> on %3$s in %4$s', 'coope'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date, $post_categories) . '</div>';
             $items .= $item_figure;
             if ($post_format == "quote") {
                 $items .= '<div class="quote-excerpt heading-font">' . get_the_content() . '</div>';
             } else {
                 $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
             }
             $items .= '<div class="read-more-bar"><a class="read-more" href="' . $post_permalink . '">' . __("Keep Reading", "coope") . '<i class="icon-chevron-right"></i></a>';
             $items .= '<div class="comments-likes">';
             if (comments_open()) {
                 $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> ';
             }
             if (function_exists('lip_love_it_link')) {
                 $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
             }
             $items .= '</div></div>';
         } else {
             $items .= '<div class="blog-details-wrap">';
             $items .= '<h2><a href="' . $post_permalink . '">' . $post_title . '</a></h2>';
             $items .= '<div class="blog-item-details clearfix">' . sprintf(__('By <a href="%2$s">%1$s</a> on %3$s in %4$s', 'coope'), $post_author, get_author_posts_url(get_the_author_meta('ID')), $post_date, $post_categories);
             $items .= '<div class="comments-likes">';
             if (comments_open()) {
                 $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> ';
             }
             if (function_exists('lip_love_it_link')) {
                 $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
             }
             $items .= '</div></div>';
             $items .= $item_figure;
             if ($post_format == "quote") {
                 $items .= '<div class="quote-excerpt heading-font">' . get_the_content() . '</div>';
             } else {
                 $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
             }
             $items .= '<a class="read-more" href="' . $post_permalink . '">' . __("Keep Reading", "coope") . '<i class="icon-chevron-right"></i></a>';
         }
         $items .= '</div></li>';
         $item_figure = '';
     }
     wp_reset_postdata();
     $items .= '</ul>';
     // PAGINATION
     if ($pagination == "yes") {
         $items .= '<div class="pagination-wrap full-width">';
         $items .= pagenavi($blog_items);
         $items .= '</div>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="wpb_blog_widget wpb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="wpb_wrapper blog-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3></div>' : '';
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     if ($blog_type == "masonry") {
         global $include_isotope;
         $include_isotope = true;
     }
     global $has_blog;
     $has_blog = true;
     return $output;
 }
Пример #10
0
        $href = $file['url'];
        echo '<a href="' . $resource . '" target="_blank">' . get_the_title() . '</a>';
    }
    if (!empty($resource)) {
        $href = $resource;
        $hrefCheck = substr($href, 0, 4);
        if ($hrefCheck !== 'http') {
            echo '<a href="http://' . $resource . '" target="_blank">' . get_the_title() . '</a>';
        } else {
            echo '<a href="' . $resource . '" target="_blank">' . get_the_title() . '</a>';
        }
    }
    ?>
    </h3>
    <?php 
    custom_excerpt(20);
    ?>
    <p class="meta"><a href="<?php 
    echo $resource;
    ?>
"><?php 
    echo $resource;
    ?>
</a></p>
  </div>
  <div class="data-extra">
    <?php 
    if (count($cats) > 0) {
        foreach ($cats as $term) {
            echo '<a href="' . get_bloginfo('url') . '/data-category/' . $term->slug . '">';
            echo '<img src="' . get_template_directory_uri() . '/images/icons/jess3_intel_ndoch_microsite_' . str_replace('-', '', $term->slug) . '.svg">';
Пример #11
0
    function widget($args, $instance)
    {
        extract($args);
        /* Set up some default widget settings. */
        $defaults = array('num_posts' => __(4, num_posts));
        $instance = wp_parse_args((array) $instance, $defaults);
        /* Before widget (defined by themes). */
        echo $before_widget;
        $displayedTitle = "Related Content";
        /* Display the widget title if one was input (before and after defined by themes). */
        if ($title) {
            $displayedTitle = $before_title . $title . $after_title;
        }
        ?>
    <div class="sideFindRelatedContent">
     <h3><?php 
        echo $displayedTitle;
        ?>
</h3>
			<ul class="relatedContentList">
			<?php 
        // for use in the loop, list 4 post titles related to first tag on current post
        $tags = wp_get_post_tags($GLOBALS['post']->ID);
        if ($tags) {
            $num_posts = apply_filters('num_posts', $instance['num_posts']);
            $first_tag = $tags[0]->term_id;
            $args = array('tag__in' => array($first_tag), 'post__not_in' => array($post->ID), 'post_type' => array('post', 'page'), 'posts_per_page' => $num_posts, 'ignore_sticky_posts' => 1);
            $related_query = new WP_Query($args);
            if ($related_query->have_posts()) {
                while ($related_query->have_posts()) {
                    $related_query->the_post();
                    $pid = $post->ID;
                    $thumbId = get_post_thumbnail_id($pid);
                    $iurl = wp_get_attachment_url($thumbId);
                    ?>
						<li><a class="contentLink" href="<?php 
                    the_permalink();
                    ?>
">
							<img class="contentThumb" src="<?php 
                    echo $iurl;
                    ?>
" alt="<?php 
                    the_title();
                    ?>
">
							<?php 
                    the_title();
                    ?>
						</a> <span class="contentBrief"><?php 
                    echo custom_excerpt(10);
                    ?>
</span></li>

				<?php 
                }
            }
            wp_reset_query();
        }
        ?>
				</ul>
    </div>
    <!-- /.sideFindRelatedContent -->

    <?php 
        echo $after_widget;
    }
Пример #12
0
echo '</a>';
echo '</div>';
echo '<div class="col-md-7 alm-content">';
echo '<div class="content">';
echo '<h2 class="entry-title">
		<a href="' . esc_url(get_permalink()) . '">' . short_title("...", 15) . '</a></h2>';
?>
		
		<?php 
echo '<small class="author"><i>';
the_author();
echo '</i></small>';
?>
		<!--/ The Date -->
		<small class="date" style="margin-left:-4px;">
        <i>
		<?php 
the_time('F j, Y');
?>
        </i>
		</small>

		<?php 
custom_excerpt('large_excerpt_length', 'ellipsis');
echo '<a href="' . esc_url(get_permalink()) . '" class="pull-right readmore">Read More ›</a>';
echo '</div>';
// content
echo '</div>';
?>
</div>
</div>
Пример #13
0
 protected function content($atts, $content = null)
 {
     $options = get_option('sf_flexform_options');
     $title = $category = $item_class = $excerpt_length = $width = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "category" => 'all', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $carouselID;
     if ($carouselID == "") {
         $carouselID = 1;
     } else {
         $carouselID++;
     }
     $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'category_name' => $category_slug, 'posts_per_page' => $item_count);
     $blog_items = new WP_Query($blog_args);
     $count = $columns = 0;
     $sidebar_config = get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $item_class = 'span2';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $item_class = 'span-bs-quarter';
         } else {
             $item_class = 'span3';
         }
     }
     if ($width == "1/4") {
         $columns = 1;
     } else {
         if ($width == "1/2") {
             $columns = 2;
         } else {
             if ($width == "3/4") {
                 $columns = 3;
             } else {
                 $columns = 4;
             }
         }
     }
     $items .= '<ul id="carousel-' . $carouselID . '" class="blog-items carousel-items clearfix" data-columns="' . $columns . '">';
     while ($blog_items->have_posts()) {
         $blog_items->the_post();
         $item_title = get_the_title();
         $post_author = get_the_author_link();
         $post_date = get_the_date();
         $post_comments = get_comments_number();
         $post_categories = get_the_category_list(', ');
         $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $item_title = get_the_title();
         $post_permalink = get_permalink();
         $custom_excerpt = get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = excerpt($excerpt_length);
         }
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="view"';
                     $item_icon = "search";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                         $item_icon = "search";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'href="' . $thumb_lightbox_video_url . '" rel="prettyPhoto"';
                             $item_icon = "facetime-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "file-alt";
                         }
                     }
                 }
             }
         }
         $items .= '<li data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">';
         $items .= '<figure>';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = video_embed($thumb_video, 270, 202);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></li>";
                 }
                 $items .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>';
             } else {
                 $image = aq_resize($thumb_img_url, 420, 315, true, false);
                 $items .= '<a ' . $link_config . '>';
                 if ($image) {
                     $items .= '<div class="overlay"><div class="thumb-info">';
                     $items .= '<i class="icon-' . $item_icon . '"></i>';
                     $items .= '</div></div>';
                     $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                 }
                 $items .= '</a>';
             }
         }
         $items .= '</figure>';
         $items .= '<div class="details-wrap">';
         // POST TITLE
         if ($show_title == "yes") {
             $items .= '<h4><a href="' . $post_permalink . '">' . $item_title . '</a></h4>';
         }
         // POST EXCERPT
         if ($excerpt_length != "0" && $show_excerpt == "yes") {
             $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
         }
         $items .= '</div>';
         // POST DETAILS
         if ($show_details == "yes") {
             $items .= '<div class="post-item-details clearfix">';
             $items .= '<span class="post-date">' . $post_date . '</span>';
             $items .= '<div class="comments-likes">';
             if (comments_open()) {
                 $items .= '<a href="' . $post_permalink . '#comment-area"><i class="icon-comments"></i><span>' . $post_comments . '</span></a> ';
             }
             if (function_exists('lip_love_it_link')) {
                 $items .= lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
             }
             $items .= '</div>';
             $items .= '</div>';
         }
         $items .= '</li>';
         $count++;
     }
     wp_reset_query();
     $items .= '</ul>';
     $items .= '<a href="#" class="prev"><i class="icon-chevron-left"></i></a><a href="#" class="next"><i class="icon-chevron-right"></i></a>';
     $width = wpb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="wpb_posts_carousel_widget wpb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="wpb_wrapper carousel-wrap">';
     if ($title != '') {
         $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3></div>';
     } else {
         $output .= "\n\t\t\t" . '<div class="heading-wrap"></div>';
     }
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $include_carousel, $include_isotope;
     $include_carousel = true;
     $include_isotope = true;
     return $output;
 }
Пример #14
0
$postType = get_post_type();
$headerText = 'General';
$excerpt = '';
if ($postType == 'post') {
    $headerText = 'Blog';
    $date = get_the_time('j \\d\\e\\ F \\d\\e\\ Y ');
    $postAuthor = get_the_author_meta('display_name', $post->post_author);
    $excerpt = get_the_excerpt();
} elseif ($postType == 'videos') {
    $headerText = 'Video';
    $excerpt = custom_excerpt(get_post_meta($post->ID, '_cmb2_sinopsis', true), 40);
    $tax = ['director', 'prod_year'];
    $meta = moebius_get_fields($tax);
} elseif ($postType == 'textos') {
    $headerText = 'Texto';
    $excerpt = custom_excerpt(get_post_meta($post->ID, '_cmb2_resumen', true), 40);
    $tax = ['director', 'prod_year'];
    $meta = moebius_get_fields($tax);
}
?>

<article id="post-<?php 
the_ID();
?>
" <?php 
post_class('m-all t-1of2 d-1of2 ld-1of3');
?>
 role="article" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">
  <span class="gallery-post-type"><?php 
echo $headerText;
?>
Пример #15
0
									<li><a class="contentLink" href="<?php 
            the_permalink();
            ?>
">
										<img class="contentThumb" src="<?php 
            echo $iurl;
            ?>
" alt="<?php 
            the_title();
            ?>
">
										<?php 
            the_title();
            ?>
									</a> <span class="contentBrief"><?php 
            echo custom_excerpt(10);
            ?>
</span></li>
									
							<?php 
        }
    }
    wp_reset_query();
}
?>
								</ul>
						</div>
						<!-- /.sideFindRelatedContent -->
						<div class="sideQuote">
							<p class="quoteTxt">“<?php 
echo $quote;
Пример #16
0
            <span class="glyphicon glyphicon-calendar"></span>
            <?php 
        the_time('F jS, Y');
        ?>
          </span>
          <span class="post-readtime small-light-text">
            <span class="glyphicon glyphicon-time"></span>
            <?php 
        echo round(wcount() / 250, 0);
        ?>
 minute read
          </span> 
        </div>
        <div class="post-entry">
          <?php 
        custom_excerpt(75, '...More');
        ?>
        </div>
        <div class="post-extras">
          <?php 
        get_template_part('partials/post', 'metadata');
        ?>
        </div>
        <?php 
    }
    ?>

      <?php 
} else {
    ?>
        <p><?php 
Пример #17
0
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
 
    <meta charset="utf-8">  
    
    <title><?php 
echo is_single() ? get_the_title() : bloginfo('name');
?>
</title> <!--insert your title here-->  
    <meta property="og:description" content="<?php 
echo is_singular('news') ? custom_excerpt('maxchar=100') : bloginfo('description');
?>
"> <!--insert your description here-->  
    <meta property="og:author" content="Екокемп"> <!--insert your property here-->
    <meta property="og:image" content="<?php 
echo wp_get_attachment_url(get_post_thumbnail_id($post->ID));
?>
">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!--meta responsive-->
    
    <?php 
wp_head();
?>
</head>  

<body id="start_nicdark_framework">
Пример #18
0
 protected function content($atts, $content = null)
 {
     $title = $category = $item_class = $excerpt_length = $width = $el_class = $output = $filter = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "category" => 'all', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query;
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'category_name' => $category_slug, 'posts_per_page' => $item_count);
     $blog_items = query_posts($args);
     $count = 0;
     if (have_posts()) {
         $items .= '<ul class="blog-items carousel-items clearfix">';
         while (have_posts()) {
             the_post();
             $item_title = get_the_title();
             $post_author = get_the_author_link();
             $post_date = get_the_date();
             $post_comments = get_comments_number();
             $thumb_type = get_post_meta($post->ID, 'coope_thumbnail_type', true);
             $thumb_image = rwmb_meta('coope_thumbnail_image', 'type=image&size=full');
             $thumb_video = get_post_meta($post->ID, 'coope_thumbnail_video_url', true);
             $thumb_gallery = rwmb_meta('coope_thumbnail_gallery', 'type=image&size=thumb-image');
             $thumb_link_type = get_post_meta($post->ID, 'coope_thumbnail_link_type', true);
             $thumb_link_url = get_post_meta($post->ID, 'coope_thumbnail_link_url', true);
             $thumb_lightbox_thumb = rwmb_meta('coope_thumbnail_image', 'type=image&size=large');
             $thumb_lightbox_image = rwmb_meta('coope_thumbnail_link_image', 'type=image&size=large');
             $thumb_lightbox_video_url = get_post_meta($post->ID, 'coope_thumbnail_link_video_url', true);
             foreach ($thumb_image as $detail_image) {
                 $thumb_img_url = $detail_image['url'];
                 break;
             }
             if (!$thumb_image) {
                 $thumb_image = get_post_thumbnail_id();
                 $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
             }
             $item_title = get_the_title();
             $permalink = get_permalink();
             $custom_excerpt = get_post_meta($post->ID, 'coope_custom_excerpt', true);
             $post_excerpt = '';
             if ($custom_excerpt != '') {
                 $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length);
             } else {
                 $post_excerpt = excerpt($excerpt_length);
             }
             $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
             if ($thumb_link_type == "link_to_url") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
                 $item_icon = "link";
             } else {
                 if ($thumb_link_type == "link_to_url_nw") {
                     $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                     $item_icon = "link";
                 } else {
                     if ($thumb_link_type == "lightbox_thumb") {
                         $link_config = 'href="' . $thumb_img_url . '" class="view"';
                         $item_icon = "search";
                     } else {
                         if ($thumb_link_type == "lightbox_image") {
                             $lightbox_image_url = '';
                             foreach ($thumb_lightbox_image as $image) {
                                 $lightbox_image_url = $image['full_url'];
                             }
                             $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                             $item_icon = "search";
                         } else {
                             if ($thumb_link_type == "lightbox_video") {
                                 $link_config = 'href="' . $thumb_lightbox_video_url . '" class="fancybox-media"';
                                 $item_icon = "facetime-video";
                             } else {
                                 $link_config = 'href="' . $permalink . '" class="link-to-post"';
                                 $item_icon = "file";
                             }
                         }
                     }
                 }
             }
             if ($thumb_type == "image") {
                 $item_class .= "image-item";
             }
             $items .= '<li data-id="id-' . $count . '" class="clearfix recent-post four columns ' . $item_class . '">';
             $items .= '<figure>';
             // THUMBNAIL MEDIA TYPE SETUP
             if ($thumb_type == "video") {
                 $video = video_embed($thumb_video, 220, 165);
                 $items .= $video;
             } else {
                 if ($thumb_type == "slider") {
                     $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                     foreach ($thumb_gallery as $image) {
                         $alt = $image['alt'];
                         if (!$alt) {
                             $alt = $image['title'];
                         }
                         $items .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></li>";
                     }
                     $items .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>';
                 } else {
                     $image = aq_resize($thumb_img_url, 420, 315, true, false);
                     $items .= '<a ' . $link_config . '>';
                     $items .= '<div class="overlay"><div class="thumb-info">';
                     if (comments_open()) {
                         $items .= '<div class="overlay-comments"><i class="icon-comment"></i><span>' . $post_comments . '</span></div>';
                     }
                     if (function_exists('lip_love_it_nolink')) {
                         $items .= lip_love_it_nolink(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false);
                     }
                     $items .= '</div></div>';
                     if ($image) {
                         $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     }
                     $items .= '</a>';
                 }
             }
             $items .= '</figure>';
             if ($show_title == "yes") {
                 $items .= '<h4 class="blog-item-title"><a href="' . $permalink . '">' . $item_title . '</a></h4>';
             }
             if ($show_details == "yes") {
                 $items .= '<div class="post-item-details">' . sprintf(__('By %1$s on %2$s', 'coope'), $post_author, $post_date) . '</div>';
             }
             if ($show_excerpt == "yes") {
                 $items .= '<div class="blog-item-excerpt">' . $post_excerpt . '</div>';
             }
             $items .= '</li>';
             $count++;
             $item_class = "";
         }
         wp_reset_query();
         $items .= '</ul>';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="wpb_posts_carousel_widget wpb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="wpb_wrapper carousel-wrap">';
     if ($title != '') {
         $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3><div class="carousel-nav"><a href="#" class="carousel-prev"><i class="icon-chevron-left"></i></a><a href="#" class="carousel-next"><i class="icon-chevron-right"></i></a></div></div>';
     } else {
         $output .= "\n\t\t\t" . '<div class="heading-wrap"><div class="carousel-nav"><a href="#" class="carousel-prev"><i class="icon-chevron-left"></i></a><a href="#" class="carousel-next"><i class="icon-chevron-right"></i></a></div></div>';
     }
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $include_carousel;
     $include_carousel = true;
     return $output;
 }
Пример #19
0
    function widget($args, $instance)
    {
        extract($args);
        $share_title = $instance['share_title'];
        $share_type = $instance['share_type'];
        $share_facebook = $instance['share_site_facebook'];
        $share_googleplus = $instance['share_site_googleplus'];
        $share_twitter = $instance['share_site_twitter'];
        $share_twitter_username = $instance['share_site_twitter_username'];
        $share_linkedin = $instance['share_site_linkedin'];
        $share_pinterest = $instance['share_site_pinterest'];
        $share_tumblr = $instance['share_site_tumblr'];
        $share_buffer = $instance['share_site_buffer'];
        $share_digg = $instance['share_site_digg'];
        $share_reddit = $instance['share_site_reddit'];
        $share_stumbleupon = $instance['share_site_stumbleupon'];
        $share_delicious = $instance['share_site_delicious'];
        wp_enqueue_script('sharethis-style', plugins_url('custom-sharethis-widget.js', __FILE__));
        $hashtags = 'Vancouver';
        $link = urlencode(get_the_permalink());
        $title = urlencode(get_the_title());
        $url = urlencode(get_bloginfo('url'));
        $desc = urlencode(strip_tags(custom_excerpt(35, false, false)));
        // Image
        $image = false;
        if (isset(get_field('hero_images')[0]['hero_image']) && get_the_ID()) {
            $heroes = get_field('hero_images');
        } else {
            if (is_home()) {
                $heroes = get_field('hero_images', 'option');
            }
        }
        if ($heroes) {
            $image = $heroes[0]['hero_image']['url'];
        } elseif (has_post_thumbnail() && !is_archive()) {
            $image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
            $image = $image[0];
        } else {
            $image = get_bloginfo('template_url') . '/images/og-logo.png';
        }
        $urls = array('facebook' => 'http://www.facebook.com/sharer/sharer.php?u=' . $link, 'googleplus' => 'https://plus.google.com/share?url=' . $link . '&amp;appkey=&title=' . $title, 'twitter' => 'https://twitter.com/share?url=' . $link . '&amp;text=' . $title . '&amp;via=' . $share_twitter_username . '&amp;hashtags=' . $hashtags, 'linkedin' => 'https://www.linkedin.com/shareArticle?mini=true&url=' . $link . '&amp;title=' . $title . '&amp;source=' . $url . '&amp;summary=' . $desc, 'pinterest' => 'https://pinterest.com/pin/create/bookmarklet/?url=' . $link . '&amp;image=' . $image . '&amp;description=' . $title, 'tumblr' => 'http://www.tumblr.com/share/link?url=' . $link . '&amp;name=' . $title . '&amp;description=' . $desc, 'buffer' => 'http://bufferapp.com/add?text=' . $title . '&url=' . $link . '', 'digg' => 'http://digg.com/submit?url=' . $link . '&title=' . $title, 'reddit' => 'http://reddit.com/submit?url=' . $link . '&title=' . $title, 'stumbleupon' => 'http://www.stumbleupon.com/submit?url=' . $link . '&title=' . $title, 'delicious' => 'https://delicious.com/save?v=5&provider={provider}&noui&jump=close&url=' . $link . '&title=' . $title);
        echo $before_widget;
        ?>
		<div class="social-share <?php 
        echo $share_type;
        ?>
">
			<span class="social-share-text"><?php 
        echo $share_title;
        ?>
</span>
			<ul class="social-share-links">
				<?php 
        if ($share_facebook) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['facebook'];
            ?>
" class="social-share-item js-share_link facebook" data-vec-share-site="Facebook">Facebook</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_googleplus) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['twitter'];
            ?>
" class="social-share-item js-share_link twitter" data-vec-share-site="Twitter">Twitter</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_twitter) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['googleplus'];
            ?>
" class="social-share-item js-share_link googleplus" data-vec-share-site="GooglePlus">Google+</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_linkedin) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['linkedin'];
            ?>
" class="social-share-item js-share_link linkedin" data-vec-share-site="LinkedIn">LinkedIn</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_pinterest) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['pinterest'];
            ?>
" class="social-share-item js-share_link pinterest" data-vec-share-site="Pinterest">Pinterest</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_tumblr) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['tumblr'];
            ?>
" class="social-share-item js-share_link tumblr" data-vec-share-site="tumblr">tumblr</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_buffer) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['buffer'];
            ?>
" class="social-share-item js-share_link buffer" data-vec-share-site="buffer">buffer</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_digg) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['digg'];
            ?>
" class="social-share-item js-share_link digg" data-vec-share-site="digg">digg</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_reddit) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['reddit'];
            ?>
" class="social-share-item js-share_link reddit" data-vec-share-site="reddit">reddit</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_stumbleupon) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['stumbleupon'];
            ?>
" class="social-share-item js-share_link stumbleupon" data-vec-share-site="stumbleupon">stumbleupon</a></li>
				<?php 
        }
        ?>
				<?php 
        if ($share_delicious) {
            ?>
					<li class="social-share-li"><a href="<?php 
            echo $urls['delicious'];
            ?>
" class="social-share-item js-share_link delicious" data-vec-share-site="delicious">delicious</a></li>
				<?php 
        }
        ?>
			</ul>
		</div>
		<?php 
        echo $after_widget;
    }
Пример #20
0
            <span class="glyphicon glyphicon-calendar"></span>
            <?php 
        the_time('F jS, Y');
        ?>
          </span>
          <span class="post-readtime small-light-text">
            <span class="glyphicon glyphicon-time"></span>
            <?php 
        echo round(wcount() / 250, 0);
        ?>
 minute read
          </span> 
        </div>
        <div class="post-entry">
          <?php 
        custom_excerpt(150, '...More');
        ?>
        </div>
        <div class="post-extras">
          <?php 
        get_template_part('partials/post', 'metadata');
        ?>
        </div>
        <?php 
    }
    ?>

      <?php 
} else {
    ?>
        <p><?php 
Пример #21
0
function network_latest_posts($how_many = 10, $how_long = 0, $titleOnly = true, $begin_wrap = "\n<li>", $end_wrap = "</li>", $blog_id = 'null', $thumbnail = false, $cpt = "post", $ignore_blog = 'null', $cat = 'null', $tag = 'null', $paginate = false, $excerpt_length = 'null', $display_root = false)
{
    global $wpdb;
    global $table_prefix;
    $counter = 0;
    $hack_cont = 0;
    // Custom post type
    $cpt = htmlspecialchars($cpt);
    // Ignore blog or blogs
    // if the user passes one value
    if (!preg_match("/,/", $ignore_blog)) {
        // Always clean this stuff ;)
        $ignore_blog = htmlspecialchars($ignore_blog);
        // Check if it's numeric
        if (is_numeric($ignore_blog)) {
            // and put the sql
            $ignore = " AND blog_id != {$ignore_blog} ";
        }
        // if the user passes more than one value separated by commas
    } else {
        // create an array
        $ignore_arr = explode(",", $ignore_blog);
        // and repeat the sql for each ID found
        for ($z = 0; $z < count($ignore_arr); $z++) {
            $ignore .= " AND blog_id != {$ignore_arr[$z]}";
        }
    }
    // get a list of blogs in order of most recent update. show only public and nonarchived/spam/mature/deleted
    if ($how_long > 0) {
        // Select by blog id
        if (!empty($blog_id) && $blog_id != 'null') {
            $blog_id = htmlspecialchars($blog_id);
            $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs} WHERE\n                       public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n                       AND blog_id = {$blog_id} {$ignore} AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                       ORDER BY last_updated DESC");
        } else {
            $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs} WHERE\n                       public = '1' {$ignore} AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n                       AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                       ORDER BY last_updated DESC");
        }
    } else {
        if (!empty($blog_id) && $blog_id != 'null') {
            $blog_id = htmlspecialchars($blog_id);
            $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs} WHERE\n                        public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id = {$blog_id}\n                        {$ignore} ORDER BY last_updated DESC");
        } else {
            $blogs = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs} WHERE\n                        public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n                        {$ignore} ORDER BY last_updated DESC");
        }
    }
    if ($blogs) {
        // Count how many blogs we've found
        $nblogs = count($blogs);
        // Lets dig into each blog
        foreach ($blogs as $blognlp) {
            // we need _posts and _options tables for this to work
            // Get the options table for each blog
            if ($display_root == true) {
                if ($blognlp == 1) {
                    $blogOptionsTable = $wpdb->base_prefix . "options";
                    // Get the posts table for each blog
                    $blogPostsTable = $wpdb->base_prefix . "posts";
                    // Get the terms relationships table for each blog
                    $blogTermRelationship = $wpdb->base_prefix . "term_relationships";
                    // Get the term taxonomy table for each blog
                    $blogTermTaxonomy = $wpdb->base_prefix . "term_taxonomy";
                    // Get the terms table for each blog
                    $blogTerms = $wpdb->base_prefix . "terms";
                } else {
                    $blogOptionsTable = $wpdb->base_prefix . $blognlp . "_options";
                    // Get the posts table for each blog
                    $blogPostsTable = $wpdb->base_prefix . $blognlp . "_posts";
                    // Get the terms relationships table for each blog
                    $blogTermRelationship = $wpdb->base_prefix . $blognlp . "_term_relationships";
                    // Get the term taxonomy table for each blog
                    $blogTermTaxonomy = $wpdb->base_prefix . $blognlp . "_term_taxonomy";
                    // Get the terms table for each blog
                    $blogTerms = $wpdb->base_prefix . $blognlp . "_terms";
                }
            } else {
                $blogOptionsTable = $wpdb->base_prefix . $blognlp . "_options";
                // Get the posts table for each blog
                $blogPostsTable = $wpdb->base_prefix . $blognlp . "_posts";
                // Get the terms relationships table for each blog
                $blogTermRelationship = $wpdb->base_prefix . $blognlp . "_term_relationships";
                // Get the term taxonomy table for each blog
                $blogTermTaxonomy = $wpdb->base_prefix . $blognlp . "_term_taxonomy";
                // Get the terms table for each blog
                $blogTerms = $wpdb->base_prefix . $blognlp . "_terms";
            }
            // --- Because the categories and tags are handled the same way by WP
            // --- I'm hacking the $cat variable so I can use it for both without
            // --- repeating the code
            if (!empty($cat) && $cat != 'null' && (empty($tag) || $tag == 'null')) {
                // Categories
                $cat_hack = $cat;
                $taxonomy = "taxonomy = 'category'";
            } elseif (!empty($tag) && $tag != 'null' && (empty($cat) || $cat == 'null')) {
                // Tags
                $cat_hack = $tag;
                $taxonomy = "taxonomy = 'post_tag'";
            } elseif (!empty($cat) && $cat != 'null' && !empty($tag) && $tag != 'null') {
                // Categories & Tags
                $cat_hack = $cat . "," . $tag;
                $taxonomy = "(taxonomy = 'category' OR taxonomy = 'post_tag')";
            }
            // --- Categories
            if (!empty($cat_hack) && $cat_hack != 'null') {
                if (!preg_match('/,/', $cat_hack)) {
                    $cat_hack = htmlspecialchars($cat_hack);
                    // Get the category's ID
                    $catid = $wpdb->get_results("SELECT term_id FROM {$blogTerms} WHERE slug = '{$cat_hack}'");
                    $cats[$blognlp] = $catid[0]->term_id;
                } else {
                    $cat_arr = explode(',', $cat_hack);
                    for ($x = 0; $x < count($cat_arr); $x++) {
                        $cat_ids = $wpdb->get_results("SELECT term_id FROM {$blogTerms} WHERE slug = '{$cat_arr[$x]}' ");
                        if (!empty($cat_ids[0]->term_id)) {
                            // Get the categories' IDs
                            $catsa[$blognlp][] = $cat_ids[0]->term_id;
                        }
                    }
                }
            }
            // Let's find the ID for the category(ies) or tag(s)
            if (count($cats[$blognlp]) == 1) {
                $taxo = $wpdb->get_results("SELECT term_taxonomy_id FROM {$blogTermTaxonomy} WHERE {$taxonomy} AND term_id = " . $cats[$blognlp]);
                $taxs[$blognlp] = $taxo[0]->term_taxonomy_id;
            } elseif (count($catsa[$blognlp]) >= 1) {
                for ($y = 0; $y < count($catsa[$blognlp]); $y++) {
                    $tax_id = $wpdb->get_results("SELECT term_taxonomy_id FROM {$blogTermTaxonomy} WHERE {$taxonomy} AND term_id = " . $catsa[$blognlp][$y]);
                    if (!empty($tax_id[0]->term_taxonomy_id)) {
                        $taxsa[$blognlp][] = $tax_id[0]->term_taxonomy_id;
                    }
                }
            }
            // Next, let's find how they are related to the posts
            if (count($taxs[$blognlp]) == 1) {
                $pids = $wpdb->get_results("SELECT object_id FROM {$blogTermRelationship} WHERE term_taxonomy_id = " . $taxs[$blognlp]);
                for ($w = 0; $w < count($pids); $w++) {
                    $postids[$blognlp][] = $pids[$w]->object_id;
                }
            } elseif (count($taxsa[$blognlp]) >= 1) {
                for ($w = 0; $w < count($taxsa[$blognlp]); $w++) {
                    $p_id = $wpdb->get_results("SELECT object_id FROM {$blogTermRelationship} WHERE term_taxonomy_id = " . $taxsa[$blognlp][$w]);
                    for ($q = 0; $q < count($p_id); $q++) {
                        $postidsa[$blognlp][] = $p_id[$q]->object_id;
                    }
                }
            }
            // Finally let's find the posts' IDs
            if (count($postids[$blognlp]) == 1) {
                $filter_cat = " AND ID = " . $postids[$blognlp];
                if (!empty($filter_cat)) {
                    if (!preg_match('/\\(/', $filter_cat)) {
                        $needle = ' AND ';
                        $replacement = ' AND (';
                        $filter_cat = str_replace($needle, $replacement, $filter_cat);
                    }
                }
            } elseif (count($postids[$blognlp]) > 1) {
                for ($v = 0; $v < count($postids[$blognlp]); $v++) {
                    if ($v == 0 && $hack_cont == 0) {
                        $filter_cat .= " AND ID = " . $postids[$blognlp][$v];
                        $hack_cont++;
                    } elseif ($hack_cont > 0) {
                        $filter_cat .= " OR ID = " . $postids[$blognlp][$v];
                    }
                }
                if (!empty($filter_cat)) {
                    if (!preg_match('/\\(/', $filter_cat)) {
                        $needle = ' AND ';
                        $replacement = ' AND (';
                        $filter_cat = str_replace($needle, $replacement, $filter_cat);
                    }
                }
            } elseif (count($postidsa[$blognlp]) >= 1) {
                for ($v = 0; $v < count($postidsa[$blognlp]); $v++) {
                    if ($v == 0 && $hack_cont == 0) {
                        $filter_cat .= " AND ID = " . $postidsa[$blognlp][$v];
                        $hack_cont++;
                    } elseif ($hack_cont > 0) {
                        $filter_cat .= " OR ID = " . $postidsa[$blognlp][$v];
                    }
                }
                if (!empty($filter_cat)) {
                    if (!preg_match('/\\(/', $filter_cat)) {
                        $needle = ' AND ';
                        $replacement = ' AND (';
                        $filter_cat = str_replace($needle, $replacement, $filter_cat);
                    }
                }
            }
            // --- Categories\\
            // Get the saved options
            $options = $wpdb->get_results("SELECT option_value FROM\n                                {$blogOptionsTable} WHERE option_name IN ('siteurl','blogname')\n                                ORDER BY option_name DESC");
            // we fetch the title, excerpt and ID for the latest post
            if ($how_long > 0) {
                if (!empty($filter_cat) && !empty($cat_hack)) {
                    // Without pagination
                    if (!$paginate) {
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                                   ORDER BY id DESC LIMIT 0,{$how_many}");
                        // Paginated results
                    } else {
                        $posts_per_page = $how_many;
                        $page = isset($_GET['pnum']) ? abs((int) $_GET['pnum']) : 1;
                        $total_records = $wpdb->get_var("SELECT COUNT(ID)\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                                   ORDER BY id DESC");
                        $total = $total_records;
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                                   ORDER BY id DESC LIMIT " . ($page * $posts_per_page - $posts_per_page) . ",{$posts_per_page}");
                    }
                } elseif (empty($filter_cat) && empty($cat_hack)) {
                    // Without pagination
                    if (!$paginate) {
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                               FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                               AND ID > 1\n                                               AND post_type = '{$cpt}'\n                                               AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                               ORDER BY id DESC LIMIT 0,{$how_many}");
                        // Paginated results
                    } else {
                        $posts_per_page = $how_many;
                        $page = isset($_GET['pnum']) ? abs((int) $_GET['pnum']) : 1;
                        $total_records = $wpdb->get_var("SELECT COUNT(ID)\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   AND ID > 1\n                                                   AND post_type = '{$cpt}'\n                                                   AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                                   ORDER BY id DESC");
                        $total = $total_records;
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   AND ID > 1\n                                                   AND post_type = '{$cpt}'\n                                                   AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL {$how_long} DAY)\n                                                   ORDER BY id DESC LIMIT " . ($page * $posts_per_page - $posts_per_page) . ",{$posts_per_page}");
                    }
                }
            } else {
                if (!empty($filter_cat) && !empty($cat_hack)) {
                    // Without pagination
                    if (!$paginate) {
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC LIMIT 0,{$how_many}");
                        // Paginated results
                    } else {
                        $posts_per_page = $how_many;
                        $page = isset($_GET['pnum']) ? abs((int) $_GET['pnum']) : 1;
                        $total_records = $wpdb->get_var("SELECT COUNT(ID)\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC");
                        $total = $total_records;
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   {$filter_cat} )\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC LIMIT " . ($page * $posts_per_page - $posts_per_page) . ",{$posts_per_page}");
                    }
                } elseif (empty($filter_cat) && empty($cat_hack)) {
                    // Without pagination
                    if (!$paginate) {
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   AND ID > 1\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC LIMIT 0,{$how_many}");
                    } else {
                        $posts_per_page = $how_many;
                        $page = isset($_GET['pnum']) ? abs((int) $_GET['pnum']) : 1;
                        $total_records = $wpdb->get_var("SELECT COUNT(ID)\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   AND ID > 1\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC");
                        $total = $total_records;
                        $thispost = $wpdb->get_results("SELECT ID, post_title, post_excerpt\n                                                   FROM {$blogPostsTable} WHERE post_status = 'publish'\n                                                   AND ID > 1\n                                                   AND post_type = '{$cpt}'\n                                                   ORDER BY id DESC LIMIT " . ($page * $posts_per_page - $posts_per_page) . ",{$posts_per_page}");
                    }
                }
            }
            // if it is found put it to the output
            if ($thispost) {
                // Remember we are doing this for multiple blogs?, well we need to display
                // the number of posts chosen for each of them
                for ($i = 0; $i < count($thispost); $i++) {
                    // get permalink by ID.  check wp-includes/wpmu-functions.php
                    $thispermalink = get_blog_permalink($blognlp, $thispost[$i]->ID);
                    // If we want to show the excerpt, we do this
                    if ($titleOnly == false || $titleOnly == 'false') {
                        // Widget list
                        if ((!empty($begin_wrap) || $begin_wrap != '') && preg_match("/\\bli\\b/", $begin_wrap) && $thumbnail == false) {
                            echo $begin_wrap . '<div class="network-posts blog-' . $blognlp . '"><a href="' . $thispermalink . '">' . $thispost[$i]->post_title . '</a><span class="network-posts-source"> ' . esc_html__('published in', 'eGallery') . ' <a href="' . $options[0]->option_value . '">' . $options[1]->option_value . '</a></span><p class="network-posts-excerpt">' . the_excerpt() . '</p></div>' . $end_wrap;
                            // Shortcode
                        } else {
                            // Display thumbnail
                            if ($thumbnail) {
                                if ($i == 0) {
                                    echo '<div id="wrapper-' . $blognlp . '">';
                                }
                                echo $begin_wrap . '<div class="network-posts blog-' . $blognlp . '"><h1 class="network-posts-title"><a href="' . $thispermalink . '">' . $thispost[$i]->post_title . '</a></h1><span class="network-posts-source"> ' . __('published in', 'trans-nlp') . ' <a href="' . $options[0]->option_value . '">' . $options[1]->option_value . '</a></span><a href="' . $thispermalink . '">' . the_post_thumbnail_by_blog($blognlp, $thispost[$i]->ID) . '</a> <p class="network-posts-excerpt">' . custom_excerpt($excerpt_length, $thispost[$i]->post_excerpt, $thispermalink) . '</p>';
                                if ($i == count($thispost) - 1 && $paginate == true) {
                                    echo '<div class="network-posts-pagination">';
                                    echo paginate_links(array('base' => add_query_arg('pnum', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => ceil($total / $posts_per_page), 'current' => $page, 'type' => 'list'));
                                    echo '</div>';
                                    echo '<script type="text/javascript" charset="utf-8">
                                                           jQuery(document).ready(function(){
   
                                                                   jQuery(".blog-' . $blognlp . ' .network-posts-pagination a").live("click", function(e){
                                                                           e.preventDefault();
                                                                           var link = jQuery(this).attr("href");
                                                                           jQuery("#wrapper-' . $blognlp . '").html("<img src=\\"' . plugins_url('/img/loader.gif', __FILE__) . '\\" />");
                                                                           jQuery("#wrapper-' . $blognlp . '").load(link+" .blog-' . $blognlp . '");
   
                                                                   });
   
                                                           });
                                                       </script>';
                                }
                                echo "</div>" . $end_wrap;
                                if ($i == count($thispost) - 1) {
                                    echo "</div>";
                                }
                                // Without thumbnail
                            } else {
                                if ($i == 0) {
                                    echo '<div id="wrapper-' . $blognlp . '">';
                                }
                                echo $begin_wrap . '<div class="network-posts blog-' . $blognlp . '"><h1 class="network-posts-title"><a href="' . $thispermalink . '">' . $thispost[$i]->post_title . '</a></h1><span class="network-posts-source"> ' . __('published in', 'trans-nlp') . ' <a href="' . $options[0]->option_value . '">' . $options[1]->option_value . '</a></span><p class="network-posts-excerpt">' . custom_excerpt($excerpt_length, $thispost[$i]->post_excerpt, $thispermalink) . '</p>';
                                if ($i == count($thispost) - 1 && $paginate == true) {
                                    echo '<div class="network-posts-pagination">';
                                    echo paginate_links(array('base' => add_query_arg('pnum', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => ceil($total / $posts_per_page), 'current' => $page, 'type' => 'list'));
                                    echo '</div>';
                                    echo '<script type="text/javascript" charset="utf-8">
                                                           jQuery(document).ready(function(){
   
                                                                   jQuery(".blog-' . $blognlp . ' .network-posts-pagination a").live("click", function(e){
                                                                           e.preventDefault();
                                                                           var link = jQuery(this).attr("href");
                                                                           jQuery("#wrapper-' . $blognlp . '").html("<img src=\\"' . plugins_url('/img/loader.gif', __FILE__) . '\\" />");
                                                                           jQuery("#wrapper-' . $blognlp . '").load(link+" .blog-' . $blognlp . '");
   
                                                                   });
   
                                                           });
                                                       </script>';
                                }
                                echo "</div>" . $end_wrap;
                                if ($i == count($thispost) - 1) {
                                    echo "</div>";
                                }
                            }
                        }
                        // Otherwise we just show the titles (useful when used as a widget)
                    } else {
                        // Widget list
                        if ($i == 0) {
                            echo '<div id="wrapperw-' . $blognlp . '">';
                        }
                        if (preg_match("/\\bli\\b/", $begin_wrap)) {
                            echo $begin_wrap . '<div class="network-posts blogw-' . $blognlp . '"><a href="' . $thispermalink . '">' . $thispost[$i]->post_title . '</a>';
                            if ($i == count($thispost) - 1 && $paginate == true) {
                                echo '<div class="network-posts-pagination">';
                                echo paginate_links(array('base' => add_query_arg('pnum', '%#%'), 'format' => '', 'show_all' => false, 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => ceil($total / $posts_per_page), 'current' => $page, 'type' => 'list'));
                                echo '</div>';
                                echo '<script type="text/javascript" charset="utf-8">
                                                       jQuery(document).ready(function(){
   
                                                               jQuery(".blogw-' . $blognlp . ' .network-posts-pagination a").live("click", function(e){
                                                                       e.preventDefault();
                                                                       var link = jQuery(this).attr("href");
                                                                       jQuery("#wrapperw-' . $blognlp . '").html("<img src=\\"' . plugins_url('/img/loader.gif', __FILE__) . '\\" />");
                                                                       jQuery("#wrapperw-' . $blognlp . '").load(link+" .blogw-' . $blognlp . '");
   
                                                               });
   
                                                       });
                                                   </script>';
                            }
                            echo '</div>' . $end_wrap;
                            if ($i == count($thispost) - 1) {
                                echo "</div>";
                            }
                            // Shortcode
                        } else {
                            if ($i == 0) {
                                echo '<div id="wrapper-' . $blognlp . '">';
                            }
                            echo $begin_wrap . '<div class="network-posts blog-' . $blognlp . '"><h1 class="network-posts-title"><a href="' . $thispermalink . '">' . $thispost[$i]->post_title . '</a></h1>';
                            if ($i == count($thispost) - 1 && $paginate == true) {
                                echo '<div class="network-posts-pagination">';
                                echo paginate_links(array('base' => add_query_arg('pnum', '%#%'), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => ceil($total / $posts_per_page), 'current' => $page, 'type' => 'list'));
                                echo '</div>';
                                echo '<script type="text/javascript" charset="utf-8">
                                                       jQuery(document).ready(function(){
   
                                                               jQuery(".blog-' . $blognlp . ' .network-posts-pagination a").live("click", function(e){
                                                                       e.preventDefault();
                                                                       var link = jQuery(this).attr("href");
                                                                       jQuery("#wrapper-' . $blognlp . '").html("<img src=\\"' . plugins_url('/img/loader.gif', __FILE__) . '\\" />");
                                                                       jQuery("#wrapper-' . $blognlp . '").load(link+" .blog-' . $blognlp . '");
   
                                                               });
   
                                                       });
                                                   </script>';
                            }
                            echo '</div>' . $end_wrap;
                            if ($i == count($thispost) - 1) {
                                echo "</div>";
                            }
                        }
                    }
                }
                // Count only when all posts has been displayed
                $counter++;
            }
            // don't go over the limit of blogs
            if ($counter >= $nblogs) {
                break;
            }
        }
    }
}
Пример #22
0
function thumbnail_generator($custom_post, $featured_style, $cols = 'medium', $n = 100, $link = 0, $zoom = 0)
{
    $return = $read_more = $class = '';
    global $post;
    $more = __('Read more', 'vibe-customtypes');
    if (strlen($custom_post->post_content) > $n) {
        $read_more = '<a href="' . get_permalink($custom_post->ID) . '" class="link">' . $more . '</a>';
    }
    $cache_duration = vibe_get_option('cache_duration');
    if (!isset($cache_duration)) {
        $cache_duration = 0;
    }
    if ($cache_duration) {
        $key = $featured_style . '_' . $custom_post->post_type . '_' . $custom_post->ID;
        if (is_user_logged_in()) {
            $user_id = get_current_user_id();
            $user_meta = get_user_meta($user_id, $custom_post->ID, true);
            if (isset($user_meta)) {
                $key .= '_' . $user_id;
            }
        }
        $result = wp_cache_get($key, 'featured_block');
    } else {
        $result = false;
    }
    if (false === $result) {
        switch ($featured_style) {
            case 'course':
                $return .= '<div class="block courseitem">';
                $return .= '<div class="block_media">';
                $return .= apply_filters('vibe_thumb_featured_image', '<a href="' . get_permalink($custom_post->ID) . '">' . featured_component($custom_post->ID, $cols) . '</a>', $featured_style);
                $return .= '</div>';
                $return .= '<div class="block_content">';
                $return .= apply_filters('vibe_thumb_heading', '<h4 class="block_title"><a href="' . get_permalink($custom_post->ID) . '" title="' . $custom_post->post_title . '">' . $custom_post->post_title . '</a></h4>', $featured_style);
                $category = '';
                if (get_post_type($custom_post->ID) == 'course') {
                    $rating = get_post_meta($custom_post->ID, 'average_rating', true);
                    $rating_count = get_post_meta($custom_post->ID, 'rating_count', true);
                    $meta = '<div class="star-rating">';
                    for ($i = 1; $i <= 5; $i++) {
                        if (isset($rating)) {
                            if ($rating >= 1) {
                                $meta .= '<span class="fill"></span>';
                            } elseif ($rating < 1 && $rating > 0.4) {
                                $meta .= '<span class="half"></span>';
                            } else {
                                $meta .= '<span></span>';
                            }
                            $rating--;
                        } else {
                            $meta .= '<span></span>';
                        }
                    }
                    $meta = apply_filters('vibe_thumb_rating', $meta, $featured_style, $rating);
                    $meta .= apply_filters('vibe_thumb_reviews', '(&nbsp;' . (isset($rating_count) ? $rating_count : '0') . '&nbsp;' . __('REVIEWS', 'vibe-customtypes') . '&nbsp;)', $featured_style) . '</div>';
                    $free_course = get_post_meta($custom_post->ID, 'vibe_course_free', true);
                    $meta .= bp_course_get_course_credits(array('id' => $custom_post->ID));
                    $meta .= '<span class="clear"></span>';
                    $instructor_meta = '';
                    if (function_exists('bp_course_get_instructor')) {
                        $instructor_meta .= bp_course_get_instructor();
                    }
                    $meta .= apply_filters('vibe_thumb_instructor_meta', $instructor_meta, $featured_style);
                    $st = get_post_meta($custom_post->ID, 'vibe_students', true);
                    if (isset($st) && $st != '') {
                        $meta .= apply_filters('vibe_thumb_student_count', '<strong>' . $st . ' ' . __('Students', 'vibe-customtypes') . '</strong>');
                    }
                    $return .= $meta;
                }
                $return .= apply_filters('wplms_course_thumb_extras', '');
                // Use this filter to add Extra HTML to the course featured block
                $return .= '</div>';
                $return .= '</div>';
                break;
            case 'course2':
                $return .= '<div class="block courseitem course2">';
                $return .= '<div class="block_media">';
                $return .= apply_filters('vibe_thumb_featured_image', '<a href="' . get_permalink($custom_post->ID) . '">' . featured_component($custom_post->ID, $cols) . '</a>', $featured_style);
                $return .= '</div>';
                $return .= '<div class="block_content">';
                $return .= apply_filters('vibe_thumb_heading', '<h4 class="block_title"><a href="' . get_permalink($custom_post->ID) . '" title="' . $custom_post->post_title . '">' . $custom_post->post_title . '</a></h4>', $featured_style);
                $category = '';
                if (get_post_type($custom_post->ID) == 'course') {
                    $rating = get_post_meta($custom_post->ID, 'average_rating', true);
                    $rating_count = get_post_meta($custom_post->ID, 'rating_count', true);
                    $meta = '<div class="star-rating">';
                    for ($i = 1; $i <= 5; $i++) {
                        if (isset($rating)) {
                            if ($rating >= 1) {
                                $meta .= '<span class="fill"></span>';
                            } elseif ($rating < 1 && $rating > 0.4) {
                                $meta .= '<span class="half"></span>';
                            } else {
                                $meta .= '<span></span>';
                            }
                            $rating--;
                        } else {
                            $meta .= '<span></span>';
                        }
                    }
                    $meta = apply_filters('vibe_thumb_rating', $meta, $featured_style, $rating);
                    $meta .= apply_filters('vibe_thumb_reviews', '(&nbsp;' . (isset($rating_count) ? $rating_count : '0') . '&nbsp;' . __('REVIEWS', 'vibe-customtypes') . '&nbsp;)', $featured_style) . '</div>';
                    $free_course = get_post_meta($custom_post->ID, 'vibe_course_free', true);
                    $st = get_post_meta($custom_post->ID, 'vibe_students', true);
                    if (isset($st) && $st != '') {
                        $meta .= apply_filters('vibe_thumb_student_count', '<strong><i class="icon-users"></i>&nbsp;' . $st . '</strong>');
                    }
                    $meta .= '<span class="clear"></span>';
                    $instructor_meta = '';
                    if (function_exists('bp_course_get_instructor')) {
                        $instructor_meta .= bp_course_get_instructor();
                    }
                    $meta .= apply_filters('vibe_thumb_instructor_meta', $instructor_meta, $featured_style);
                    $meta .= bp_course_get_course_credits(array('id' => $custom_post->ID));
                    $return .= $meta;
                }
                $return .= apply_filters('wplms_course_thumb_extras', '');
                // Use this filter to add Extra HTML to the course featured block
                $return .= '</div>';
                $return .= '</div>';
                break;
            case 'side':
                $return .= '<div class="block side">';
                $return .= '<div class="block_media">';
                if (isset($link) && $link) {
                    $return .= '<span class="overlay"></span>';
                }
                if (isset($link) && $link) {
                    $return .= '<a href="' . get_permalink($custom_post->ID) . '" class="hover-link hyperlink"><i class="icon-hyperlink"></i></a>';
                }
                $featured = getPostMeta($custom_post->ID, 'vibe_select_featured');
                if (isset($zoom) && $zoom && has_post_thumbnail($custom_post->ID)) {
                    $return .= '<a href="' . wp_get_attachment_url(get_post_thumbnail_id($custom_post->ID), $cols) . '" class="hover-link pop"><i class="icon-arrows-out"></i></a>';
                }
                $return .= apply_filters('vibe_thumb_featured_image', featured_component($custom_post->ID, $cols), $featured_style);
                $category = '';
                if (get_post_type($custom_post->ID) == 'post') {
                    $cats = get_the_category();
                    if (is_array($cats)) {
                        foreach ($cats as $cat) {
                            $category .= '<a href="' . get_category_link($cat->term_id) . '">' . $cat->cat_name . '</a> ';
                        }
                    }
                }
                $return .= '</div>';
                $category = '';
                if (get_post_type($custom_post->ID) == 'post') {
                    $cats = get_the_category();
                    if (is_array($cats)) {
                        foreach ($cats as $cat) {
                            $category .= '<a href="' . get_category_link($cat->term_id) . '">' . $cat->cat_name . '</a> ';
                        }
                    }
                }
                $return .= '<div class="block_content">';
                $return .= apply_filters('vibe_thumb_heading', '<h4 class="block_title"><a href="' . get_permalink($custom_post->ID) . '" title="' . $custom_post->post_title . '">' . $custom_post->post_title . '</a></h4>', $featured_style);
                $return .= apply_filters('vibe_thumb_date', '<div class="date"><small>' . get_the_time('F d,Y') . '' . (strlen($category) > 2 ? ' / ' . $category : '') . ' / ' . get_comments_number('0', '1', '%') . ' ' . __(' Comments', 'vibe-customtypes') . '</small></div>', $featured_style);
                $return .= apply_filters('vibe_thumb_desc', '<p class="block_desc">' . custom_excerpt($n, $custom_post->ID) . '</p>', $featured_style);
                $return .= '</div>';
                $return .= '</div>';
                break;
            case 'images_only':
                $return .= '<div class="block">';
                $return .= '<div class="block_media images_only">';
                if (isset($link) && $link) {
                    $return .= '<span class="overlay"></span>';
                }
                if (isset($link) && $link) {
                    $return .= '<a href="' . get_permalink($custom_post->ID) . '" class="hover-link hyperlink"><i class="icon-hyperlink"></i></a>';
                }
                if (isset($zoom) && has_post_thumbnail($custom_post->ID) && $zoom) {
                    $return .= '<a href="' . wp_get_attachment_url(get_post_thumbnail_id($custom_post->ID), $cols) . '" class="hover-link pop"><i class="icon-arrows-out"></i></a>';
                }
                $return .= apply_filters('vibe_thumb_featured_image', featured_component($custom_post->ID, $cols), $featured_style);
                $return .= '</div>';
                $return .= '</div>';
                break;
            case 'testimonial':
                $return .= '<div class="block testimonials">';
                $author = getPostMeta($custom_post->ID, 'vibe_testimonial_author_name');
                $designation = getPostMeta($custom_post->ID, 'vibe_testimonial_author_designation');
                if (has_post_thumbnail($custom_post->ID)) {
                    $image = get_the_post_thumbnail($custom_post->ID, 'full');
                } else {
                    $image = get_avatar('*****@*****.**', 96);
                }
                $return .= '<div class="testimonial_item style2 clearfix">
                                    <div class="testimonial-content">    
                                        <p>' . custom_excerpt($n, $custom_post->ID) . ($n < strlen($custom_post->post_content) ? $read_more : '') . '</p>
                                       <div class="author">
                                          ' . $image . '  
                                          <h4>' . html_entity_decode($author) . '</h4>
                                          <small>' . html_entity_decode($designation) . '</small>
                                        </div>     
                                    </div>        
                                    
                                </div>';
                $return .= '</div>';
                break;
            case 'blogpost':
                $return .= '<div class="block blogpost">';
                $return .= '<div class="blog-item">
                                ' . apply_filters('vibe_thumb_date', '<div class="blog-item-date">
                                    <span class="day">' . get_the_time('d') . '</span>
                                    <p class="month">' . get_the_time('M') . '\'' . get_the_time('y') . '</p>
                                </div>', $featured_style) . '
                                ' . apply_filters('vibe_thumb_heading', '<h4><a href="' . get_permalink($custom_post->ID) . '" title="' . $custom_post->post_title . '">' . $custom_post->post_title . '</a></h4>', $featured_style) . '
                                <p>' . apply_filters('vibe_thumb_desc', custom_excerpt($n, $custom_post->ID), $featured_style) . '</p>
                                </div>';
                $return .= '</div>';
                break;
            case 'event_card':
                $return .= '<div class="event_card">';
                $icon_class = get_post_meta($custom_post->ID, 'vibe_icon', true);
                $color = get_post_meta($custom_post->ID, 'vibe_color', true);
                $start_date = get_post_meta($custom_post->ID, 'vibe_start_date', true);
                $end_date = get_post_meta($custom_post->ID, 'vibe_end_date', true);
                $start_time = get_post_meta($custom_post->ID, 'vibe_start_time', true);
                $end_time = get_post_meta($custom_post->ID, 'vibe_end_time', true);
                $show_location = get_post_meta($custom_post->ID, 'vibe_show_location', true);
                $all_day = get_post_meta($custom_post->ID, 'vibe_all_day', true);
                $location = vibe_sanitize(get_post_meta($custom_post->ID, 'vibe_location', false));
                $repeatable = get_post_meta($custom_post->ID, 'vibe_repeatable', true);
                $repeat_value = get_post_meta($custom_post->ID, 'vibe_repeat_value', true);
                $repeat_unit = get_post_meta($custom_post->ID, 'vibe_repeat_unit', true);
                $repeat_count = get_post_meta($custom_post->ID, 'vibe_repeat_count', true);
                $return .= ' <span class="event_icon" style="color:' . $color . '"><i class="' . $icon_class . '"></i></span>
                        <h4 style="background:' . $color . '"><i class="' . $icon_class . '"></i> ' . __('Event ', 'vibe-customtypes') . '</label><span><a href="' . get_permalink($custom_post->ID) . '">' . get_the_title($custom_post->ID) . '</a></span></h4>
                        <ul>
                        ';
                if (isset($start_date) && $start_date != '') {
                    $return .= '<li><label><i class="icon-calendar"></i> ' . __('Start Date ', 'vibe-customtypes') . '</label><span>' . date('F j Y', strtotime($start_date)) . '</span></li>';
                }
                if (isset($end_date) && $end_date != '') {
                    $return .= '<li><label><i class="icon-calendar"></i> ' . __('End Date ', 'vibe-customtypes') . '</label><span>' . date('F j Y', strtotime($end_date)) . '</span>';
                }
                if (isset($start_time) && $start_time != '') {
                    $return .= '<li><label><i class="icon-clock"></i> ' . __('Start Time ', 'vibe-customtypes') . '</label><span>' . $start_time . '</span>';
                }
                if (isset($end_time) && $end_time != '') {
                    $return .= '<li><label><i class="icon-clock"></i> ' . __('End Time ', 'vibe-customtypes') . '</label><span>' . $end_time . '</span>';
                }
                if (vibe_validate($all_day)) {
                    $return .= '<li><label><i class="icon-circle-full"></i> ' . __('All Day ', 'vibe-customtypes') . '</label><span>' . __('Yes', 'vibe-customtypes') . '</span>';
                }
                if (vibe_validate($repeatable)) {
                    $return .= '<li><label><i class="icon-flash"></i> ' . __('Frequency ', 'vibe-customtypes') . '</label><span>' . __('Every ', 'vibe-customtypes') . (isset($repeat_value) && $repeat_value > 1 ? $repeat_value : '') . ' ' . $repeat_unit . ' ' . __('for ', 'vibe-customtypes') . $repeat_count . ' ' . $repeat_unit . '</span>';
                }
                if (vibe_validate($show_location)) {
                    $return .= '<li><label><i class="icon-pin-alt"></i> ' . __('Venue ', 'vibe-customtypes') . '</label><span>' . (isset($location['staddress']) ? $location['staddress'] : '') . (isset($location['city']) ? ', ' . $location['city'] : '') . (isset($location['state']) ? ', ' . $location['state'] : '') . (isset($location['country']) ? ', ' . $location['country'] : '') . (isset($location['pincode']) ? ' - ' . $location['pincode'] : '') . '</span>';
                }
                $return .= '</ul>
                        <a href="' . get_permalink($custom_post->ID) . '" class="event_full_details tip" title="' . __('View full details', 'vibe-customtypes') . '" style="background:' . $color . '"><i class="icon-plus-1"></i></a>
                    </div>';
                break;
            default:
                $return .= '<div class="block">';
                $return .= '<div class="block_media">';
                if (isset($link) && $link) {
                    $return .= '<a href="' . get_permalink($custom_post->ID) . '" class="hover-link hyperlink"><i class="icon-hyperlink"></i></a>';
                }
                $featured = getPostMeta($custom_post->ID, 'vibe_select_featured');
                if (isset($zoom) && $zoom && has_post_thumbnail($custom_post->ID)) {
                    $return .= '<a href="' . wp_get_attachment_url(get_post_thumbnail_id($custom_post->ID), $cols) . '" class="hover-link pop"><i class="icon-arrows-out"></i></a>';
                }
                $return .= featured_component($custom_post->ID, $cols);
                $category = '';
                if (get_post_type($custom_post->ID) == 'post') {
                    $cats = get_the_category();
                    if (is_array($cats)) {
                        foreach ($cats as $cat) {
                            $category .= '<a href="' . get_category_link($cat->term_id) . '">' . $cat->cat_name . '</a> ';
                        }
                    }
                }
                $return .= '</div>';
                $category = '';
                if (get_post_type($custom_post->ID) == 'post') {
                    $cats = get_the_category();
                    if (is_array($cats)) {
                        foreach ($cats as $cat) {
                            $category .= '<a href="' . get_category_link($cat->term_id) . '">' . $cat->cat_name . '</a> ';
                        }
                    }
                }
                if (get_post_type($custom_post->ID) == 'portfolio') {
                    $cats = get_the_category();
                    if (is_array($cats)) {
                        $category .= '<div class="categories">';
                        if (!is_wp_error(get_the_term_list($custom_post->ID, 'portfolio-type', ' ', ' ', ''))) {
                            $category .= get_the_term_list($custom_post->ID, 'portfolio-type', ' ', ' ', '');
                        }
                        $category .= '</div>';
                    }
                }
                $return .= '<div class="block_content">';
                $return .= apply_filters('vibe_thumb_heading', '<h4 class="block_title"><a href="' . get_permalink($custom_post->ID) . '" title="' . $custom_post->post_title . '">' . $custom_post->post_title . '</a></h4>', $featured_style);
                $return .= apply_filters('vibe_thumb_date', '<div class="date"><small>' . get_the_time('F d,Y') . '' . (strlen($category) > 2 ? ' / ' . $category : '') . ' / ' . get_comments_number('0', '1', '%') . ' ' . __('Comments', 'vibe-customtypes') . '</small></div>', $featured_style);
                $return .= apply_filters('vibe_thumb_desc', '<p class="block_desc">' . custom_excerpt($n, $custom_post->ID) . '</p>', $featured_style);
                $return .= '</div>';
                $return .= '</div>';
                break;
        }
        if ($cache_duration) {
            wp_cache_set($course_key, $result, 'featured_block', $cache_duration);
        }
    }
    //end If
    return apply_filters('vibe_featured_thumbnail_style', $return, $custom_post, $featured_style);
}
Пример #23
0
    function widget($args, $instance)
    {
        extract($args);
        //Our variables from the widget settings.
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        // Display the widget title
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (isset($instance['taxonomy']) && $instance['taxonomy'] != '') {
            $check = term_exists($instance['term'], $instance['taxonomy']);
            if ($check == 0 || $check == null || !$check) {
                $error = new VibeErrors();
                echo $error->get_error('term_taxonomy_mismatch');
            }
            $check = is_object_in_taxonomy($instance['type'], $instance['taxonomy']);
            if ($check == 0 || $check == null || !$check) {
                $error = new VibeErrors();
                echo $error->get_error('term_postype_mismatch');
            }
        }
        $query = array('posts_per_page' => $instance['num']);
        // if($instance['type'] != 'post') {
        $query['post_type'] = $instance['type'];
        //}
        if (!empty($instance['taxonomy'])) {
            if ($instance['taxonomy'] == 'category') {
                $instance['taxonomy'] = 'category_name';
            }
            if ($instance['taxonomy'] == 'tag') {
                $instance['taxonomy'] = 'tag_name';
            }
            $query[$instance['taxonomy']] = $instance['term'];
        }
        if ($instance['sort'] == 'popular') {
            $query['orderby'] = 'comment_count';
        }
        $loop = new WP_Query($query);
        ?>
                    <div class="postlist <?php 
        echo $instance['theme'] . ' post' . $instance['size'];
        ?>
">
         <ul class="vibeposts">
                             
                <?php 
        if ($instance['style'] == 'post') {
            while ($loop->have_posts()) {
                $loop->the_post();
                $thumb = get_the_post_thumbnail($loop->post->ID, $instance['size']);
                if (isset($instance['chars']) && $instance['chars'] != '') {
                    $chars = intval($instance['chars']);
                } else {
                    $chars = 80;
                }
                echo '
                              <li>
                                <article>
                                  <div class="post_thumb">';
                echo '<a href="' . get_permalink($loop->post->ID) . '" class="' . $instance['size'] . '_thumb">' . $thumb . '</a>
                                  </div>
                                  <h4 class="post_title"><a href="' . get_permalink($loop->post->ID) . '">' . get_the_title($loop->post->ID) . '</a></h4>
                                  <p class="post_excerpt">' . custom_excerpt($chars) . '</p>
                                  </article>
                              </li>';
            }
        }
        if ($instance['style'] == 'imagetitle') {
            while ($loop->have_posts()) {
                $loop->the_post();
                $thumb = get_the_post_thumbnail($loop->post->ID, $instance['size']);
                echo '<li>
                                  <article>
                                    <div class="post_thumb">';
                echo '<a href="' . get_permalink($loop->post->ID) . '">' . $thumb . '</a>
                                    </div>
                                    <h5><a href="' . get_permalink($loop->post->ID) . '">' . get_the_title($loop->post->ID) . '</a></h5>
                                    </article>
                                </li>';
            }
        }
        if ($instance['style'] == 'image') {
            while ($loop->have_posts()) {
                $loop->the_post();
                $thumb = get_the_post_thumbnail($loop->post->ID, $instance['size']);
                echo '<li>
                                <div class="post_thumb imageonly">';
                echo '<a href="' . get_permalink($loop->post->ID) . '">' . $thumb . '</a>
                                </div>
                            </li>';
            }
        }
        if ($instance['style'] == 'title') {
            while ($loop->have_posts()) {
                $loop->the_post();
                echo '<li>
                                  <h5><a href="' . get_permalink($loop->post->ID) . '">' . get_the_title($loop->post->ID) . '</a></h5>
                              </li>';
            }
        }
        ?>
              </ul> 
          </div>  
<?php 
        // Restore original Query & Post Data
        wp_reset_query();
        wp_reset_postdata();
        echo $after_widget;
    }
 protected function content($atts, $content = null)
 {
     $title = $width = $el_class = $output = $tax_terms = $items = $el_position = '';
     extract(shortcode_atts(array('title' => '', 'portfolio_type' => 'basic', 'display_type' => 'standard', 'columns' => '4', 'show_title' => 'yes', 'show_client' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', 'item_count' => '-1', 'category' => '', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     // PORTFOLIO QUERY SETUP
     global $post, $wp_query;
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     $portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'paged' => $paged, 'portfolio-category' => $category_slug, 'posts_per_page' => $item_count);
     $portfolio_items = new WP_Query($portfolio_args);
     $count = 0;
     // LIST CLASS SETUP BASED ON SELECTED OPTIONS
     $list_class = '';
     if ($display_type == "bordered" || $display_type == "bordered_gallery") {
         $list_class .= 'bordered-items ';
     }
     if ($portfolio_type == "masonry") {
         $list_class .= 'masonry-items';
     }
     $items .= '<ul class="portfolio-items filterable-items ' . $list_class . ' clearfix">';
     // PORTFOLIO LOOP
     while ($portfolio_items->have_posts()) {
         $portfolio_items->the_post();
         // META VARIABLES
         $thumb_image = $video = $item_class = $link_config = '';
         $thumb_width = 420;
         $thumb_height = 315;
         $video_height = 315;
         $bordered_thumb_width = 408;
         $bordered_thumb_height = 303;
         $bordered_video_height = 303;
         if ($portfolio_type == "masonry") {
             $thumb_height = NULL;
             $video_height = 315;
             $bordered_thumb_height = NULL;
         }
         $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $item_title = get_the_title();
         $item_client = get_post_meta($post->ID, 'sf_portfolio_client', true);
         $permalink = get_permalink();
         $custom_excerpt = get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = excerpt($excerpt_length);
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $post_terms = get_the_terms($post->ID, 'portfolio-category');
         $term_slug = " ";
         if (!empty($post_terms)) {
             foreach ($post_terms as $post_term) {
                 $term_slug = $term_slug . strtolower(str_replace(' ', '-', $post_term->name)) . ' ';
             }
         }
         // COLUMN OPTION VARIABLES
         $item_class = $item_icon = "";
         if ($columns == "1") {
             $item_class = "one-col ";
             $excerpt = get_the_excerpt();
             $thumb_width = 940;
             $thumb_height = NULL;
             $video_height = 528;
             $bordered_thumb_width = 928;
             $bordered_thumb_height = NULL;
             $bordered_video_height = 522;
         } else {
             if ($columns == "2") {
                 $item_class = "eight ";
             } else {
                 if ($columns == "3") {
                     $item_class = "thirds ";
                 } else {
                     if ($columns == "4") {
                         $item_class = "four ";
                     }
                 }
             }
         }
         // DISPLAY TYPE VARIABLES
         if ($display_type == "standard") {
             $item_class .= "standard ";
         } else {
             if ($display_type == "bordered") {
                 $item_class .= "bordered ";
             } else {
                 if ($display_type == "gallery") {
                     $item_class .= "gallery ";
                 } else {
                     if ($display_type == "bordered_gallery") {
                         $item_class .= "gallery bordered ";
                     }
                 }
             }
         }
         if ($thumb_type == "image") {
             $item_class .= "image-item";
         }
         // LINK TYPE VARIABLES
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="view"';
                     $item_icon = "search";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="view"';
                         $item_icon = "search";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'href="' . $thumb_lightbox_video_url . '" class="fancybox-media"';
                             $item_icon = "facetime-video";
                         } else {
                             $link_config = 'href="' . $permalink . '" class="link-to-post"';
                             $item_icon = "file";
                         }
                     }
                 }
             }
         }
         $items .= '<li data-id="id-' . $count . '" class="clearfix portfolio-item ' . $item_class . ' columns' . $term_slug . '">';
         $items .= '<figure>';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             if ($display_type == "bordered" || $display_type == "bordered_gallery") {
                 $video = video_embed($thumb_video, $bordered_thumb_width, $bordered_video_height);
             } else {
                 $video = video_embed($thumb_video, $thumb_width, $video_height);
             }
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $items .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>";
                 }
                 $items .= '</ul><div class="open-item"><a ' . $link_config . '><i class="icon-plus"></i></a></div></div>';
             } else {
                 if ($display_type == "bordered" || $display_type == "bordered_gallery") {
                     $image = aq_resize($thumb_img_url, $bordered_thumb_width, $bordered_thumb_height, true, false);
                 } else {
                     $image = aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
                 }
                 if ($image) {
                     $items .= '<a ' . $link_config . '>';
                     $items .= '<div class="overlay"><div class="thumb-info">';
                     if ($display_type == "gallery" || $display_type == "bordered_gallery") {
                         $items .= '<h4>' . $item_title . '</h4>';
                         $items .= '<i class="icon-' . $item_icon . ' small-icon"></i>';
                     } else {
                         $items .= '<i class="icon-' . $item_icon . '"></i>';
                     }
                     $items .= '</div></div>';
                     $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '</a>';
                 }
             }
         }
         $items .= '</figure>';
         // ITEM INFO SETUP
         if ($display_type != "gallery" && $display_type != "bordered_gallery") {
             $items .= '<div class="portfolio-item-details">';
             if ($show_title == "yes") {
                 $items .= '<h4 class="portfolio-item-title"><a ' . $link_config . '>' . $item_title . '</a></h4>';
             }
             if ($show_client == "yes" && $item_client) {
                 $items .= '<span class="portfolio-client-title">' . $item_client . '</span>';
             }
             if ($show_excerpt == "yes") {
                 $items .= '<div class="portfolio-item-excerpt">' . $post_excerpt . '</div>';
             }
             $items .= '</div>';
         }
         $items .= '</li>';
         $count++;
     }
     wp_reset_postdata();
     $items .= '</ul>';
     // PAGINATION
     if ($pagination == "yes") {
         $items .= '<div class="pagination-wrap full-width">';
         $items .= pagenavi($portfolio_items);
         $items .= '</div>';
     }
     // PAGE BUILDER OUPUT
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $output .= "\n\t" . '<div class="wpb_portfolio_widget wpb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="wpb_wrapper portfolio-wrap">';
     $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h2 class="wpb_heading">' . $title . '</h2></div>' : '';
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $include_isotope;
     global $has_portfolio;
     $include_isotope = true;
     $has_portfolio = true;
     return $output;
 }
Пример #25
0
				</header>
		<?php 
    if (is_archive() || is_search()) {
        // Only display excerpts for archives and search.
        ?>
				<article class="entry-summary">
					<?php 
        custom_excerpt(45, "More Info");
        ?>
				</article><!-- .entry-summary -->
		<?php 
    } else {
        ?>
				<article class="entry-content">
					<?php 
        custom_excerpt(100, "More Info");
        ?>
				</article><!-- .entry-content -->
		<?php 
    }
    ?>

			</article><!-- #post-## -->

			<?php 
    comments_template('', true);
    ?>

	<?php 
}
?>
         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
         */
        // get_template_part( 'content', get_post_format() );
        ?>

				<div class="col-md-9 col-sm-6">

                    <h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
                    <p><?php 
        echo custom_excerpt(40);
        ?>
</p>
                    <p><?php 
        the_time(get_option('date_format'));
        ?>
 | <?php 
        $categories = get_the_category();
        $i = 0;
        if ($categories[0]->name == "Featured") {
            $i = 1;
        }
        if (!empty($categories)) {
            echo '<a href="' . esc_url(get_category_link($categories[$i]->term_id)) . '">' . esc_html($categories[$i]->name) . '</a>';
        }
        ?>
Пример #27
0
        the_post_thumbnail('medium-width');
        echo '</a>';
        echo '<a href="' . esc_url(get_permalink()) . '" class="hidden-lg">';
        the_post_thumbnail('full-width');
        echo '</a>';
        echo '<div class="description">';
        echo '<div class="title">';
        echo '<a href="' . esc_url(get_permalink()) . '">' . short_title("...", 8) . '</a>';
        echo '</div>';
        echo '<small class="author"><i>';
        the_author();
        echo '</i></small>';
        echo '<small class="date"><i>';
        the_time('F j, Y');
        echo '</i></small>';
        custom_excerpt('semi_medium_excerpt_length', 'ellipsis');
        echo '<a href="' . esc_url(get_permalink()) . '" class="readmore text-center">Read More ›</a>';
        echo '</div>';
        echo '</div>';
    }
    wp_reset_query();
}
?>
					
		</div>
	</div>
</div>
	<div class="row">
		<div id="primary" class="col-md-9 auditions-content">
		
					<?php 
Пример #28
0
function blog_shortcode($atts)
{
    global $data;
    wp_enqueue_script('jquery.flexslider');
    if (is_front_page() || is_home()) {
        $paged = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);
    } else {
        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    }
    // if a number of posts should be displayed using their id; got to build array
    if (isset($atts['post__in'])) {
        $atts['post__in'] = array_map('trim', explode(',', $atts['post__in']));
    }
    // only get the specified number of posts
    if (isset($atts['get_latest'])) {
        $get_latest = $atts['get_latest'];
        $atts = shortcode_atts(array('author' => '', 'author_name' => '', 'category_name' => '', 'category' => '', 'id' => false, 'p' => false, 'post__in' => false, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'post_type' => 'post', 'posts_per_page' => $atts['get_latest'], 'nopaging' => "false", 'paged' => $paged, 'tag' => '', 'tax_operator' => 'IN', 'tax_term' => false, 'taxonomy' => 'category', 'title_meta' => '', 'include_shortcodes' => false, 'blog_layout' => 'large'), $atts);
        // get specified number of posts per page
    } else {
        if (isset($atts['posts_per_page'])) {
            $atts = shortcode_atts(array('author' => '', 'author_name' => '', 'category_name' => '', 'category' => '', 'id' => false, 'p' => false, 'post__in' => false, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'post_type' => 'post', 'posts_per_page' => $atts['posts_per_page'], 'nopaging' => "true", 'paged' => $paged, 'tag' => '', 'tax_operator' => 'IN', 'tax_term' => false, 'taxonomy' => 'category', 'title_meta' => '', 'include_shortcodes' => false, 'blog_layout' => 'large'), $atts);
        } else {
            // get all posts, i.e. default
            $atts = shortcode_atts(array('author' => '', 'author_name' => '', 'category_name' => '', 'category' => '', 'id' => false, 'p' => false, 'post__in' => false, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'post_type' => 'post', 'nopaging' => "false", 'paged' => $paged, 'tag' => '', 'tax_operator' => 'IN', 'tax_term' => false, 'taxonomy' => 'category', 'title_meta' => false, 'include_shortcodes' => false, 'blog_layout' => 'large'), $atts);
        }
    }
    if ($atts['nopaging'] == 'true') {
        $atts['nopaging'] = true;
    } elseif ($atts['nopaging'] == 'false') {
        $atts['nopaging'] = false;
    }
    $ml_query = new WP_Query($atts);
    $html = '</div></div>';
    while ($ml_query->have_posts()) {
        $ml_query->the_post();
        // get the css styling classes out of the get_post_class() array
        $post_classes_values = 'class="';
        $post_classes = get_post_class();
        foreach ($post_classes as $key => $value) {
            if (strlen($post_classes_values) == 7) {
                $post_classes_values .= $value;
            } else {
                $post_classes_values .= ' ' . $value;
            }
        }
        $post_classes_values .= '"';
        $html .= '<div id="post-' . get_the_ID() . '"' . $post_classes_values . '>';
        if (!isset($atts['title_meta']) || $atts['title_meta'] == false) {
            if ($data['featured_images']) {
                $html .= '<style type="text/css">';
                if (get_post_meta(get_the_ID(), 'pyre_fimg_width', true)) {
                    $html .= '#post-' . get_the_ID() . ' .post-slideshow,
							#post-' . get_the_ID() . ' .floated-post-slideshow,
							#post-' . get_the_ID() . ' .post-slideshow .image > img,
							#post-' . get_the_ID() . ' .floated-post-slideshow .image > img
							{width:' . get_post_meta(get_the_ID(), 'pyre_fimg_width', true) . ' !important;}
					';
                }
                if (get_post_meta(get_the_ID(), 'pyre_fimg_height', true)) {
                    $html .= '#post-' . get_the_ID() . ' .post-slideshow,
							#post-' . get_the_ID() . ' .floated-post-slideshow,
							#post-' . get_the_ID() . ' .post-slideshow .image > img,
							#post-' . get_the_ID() . ' .floated-post-slideshow .image > img
							{height:' . get_post_meta(get_the_ID(), 'pyre_fimg_height', true) . ' !important;}
					';
                }
                $html .= '</style>';
                if (get_post_meta(get_the_ID(), 'pyre_image_rollover_icons', true) == 'link') {
                    $link_icon_css = '';
                    $zoom_icon_css = 'display:none;';
                } elseif (get_post_meta(get_the_ID(), 'pyre_image_rollover_icons', true) == 'zoom') {
                    $link_icon_css = 'display:none;';
                    $zoom_icon_css = '';
                } elseif (get_post_meta(get_the_ID(), 'pyre_image_rollover_icons', true) == 'no') {
                    $link_icon_css = 'display:none;';
                    $zoom_icon_css = 'display:none;';
                } else {
                    $link_icon_css = '';
                    $zoom_icon_css = '';
                }
                $icon_url_check = get_post_meta(get_the_ID(), 'pyre_link_icon_url', true);
                if (!empty($icon_url_check)) {
                    $icon_permalink = get_post_meta(get_the_ID(), 'pyre_link_icon_url', true);
                } else {
                    $icon_permalink = get_permalink(get_the_ID());
                }
                if ($data['blog_full_width']) {
                    $size = 'full';
                } else {
                    $size = 'blog-large';
                }
                if ($atts['blog_layout'] == 'large') {
                    if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                        $html .= '<div class="flexslider post-slideshow">
							<ul class="slides">';
                        if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                            $html .= '<li class="full-video">' . get_post_meta(get_the_ID(), 'pyre_video', true) . '</li>';
                        }
                        if (has_post_thumbnail(get_the_ID())) {
                            $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                            $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                            $html .= '<li>
										<div class="image">';
                            if ($data['image_rollover']) {
                                $html .= get_the_post_thumbnail(get_the_ID(), $size);
                            } else {
                                $html .= '<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), $size) . '</a>';
                            }
                            $html .= '<div class="image-extras">
													<div class="image-extras-content">';
                            $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
                            $html .= '<a style="' . $link_icon_css . '" class="icon link-icon" href="' . $icon_permalink . '">Permalink</a>';
                            if (get_post_meta(get_the_ID(), 'pyre_video_url', true)) {
                                $full_image[0] = get_post_meta(get_the_ID(), 'pyre_video_url', true);
                            }
                            $html .= '<a style="' . $zoom_icon_css . '" class="icon gallery-icon" href="' . $full_image[0] . '" rel="prettyPhoto[gallery' . get_the_ID() . ']" title="' . get_post_field('post_content', get_post_thumbnail_id()) . '"><img style="display:none;" alt="' . get_post_field('post_excerpt', get_post_thumbnail_id()) . '" />Gallery</a>
														<h3>' . get_the_title() . '</h3>
													</div>
												</div>
										</div>
									</li>';
                        }
                        if ($data['posts_slideshow']) {
                            $i = 2;
                            while ($i <= $data["posts_slideshow_number"]) {
                                $attachment_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
                                if ($attachment_id) {
                                    $attachment_image = wp_get_attachment_image_src($attachment_id, $size);
                                    $full_image = wp_get_attachment_image_src($attachment_id, 'full');
                                    $attachment_data = wp_get_attachment_metadata($attachment_id);
                                    $html .= '<li>
												<div class="image">
													<a href="' . get_permalink() . '"><img src="' . $attachment_image[0] . '" alt="' . get_post_field('post_excerpt', $new_attachment_id) . '" /></a>
													<a style="display:none;" href="' . $full_image[0] . '" rel="prettyPhoto[gallery' . get_the_ID() . ']" alt="' . get_post_field('post_excerpt', $attachment_id) . '" title="' . get_post_field('post_content', $attachment_id) . '"><img style="display:none;" alt="' . get_post_field('post_excerpt', $attachment_id) . '" /></a>
												</div>
											</li>';
                                }
                                $i++;
                            }
                        }
                        $html .= '</ul>
						</div>';
                    }
                }
                if ($atts['blog_layout'] == 'medium') {
                    if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                        $html .= '<div class="flexslider blog-medium-image floated-post-slideshow">
							<ul class="slides">';
                        if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                            $html .= '<li class="full-video">' . get_post_meta(get_the_ID(), 'pyre_video', true) . '</li>';
                        }
                        if (has_post_thumbnail(get_the_ID())) {
                            $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
                            $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id(get_the_ID()));
                            $html .= '<li>
										<div class="image">
												<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), "blog-medium") . '</a>
												<div class="image-extras">
													<div class="image-extras-content">';
                            $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
                            $html .= '<a style="' . $link_icon_css . '" class="icon link-icon" href="' . $icon_permalink . '">Permalink</a>';
                            if (get_post_meta(get_the_ID(), 'pyre_video_url', true)) {
                                $full_image[0] = get_post_meta(get_the_ID(), 'pyre_video_url', true);
                            }
                            $html .= '<a style="' . $zoom_icon_css . '" class="icon gallery-icon" href="' . $full_image[0] . '" rel="prettyPhoto[gallery' . get_the_ID() . ']">Gallery</a>
														<h3>' . get_the_title() . '</h3>
													</div>
												</div>
										</div>
									</li>';
                        }
                        if ($data['posts_slideshow']) {
                            $i = 2;
                            while ($i <= $data['posts_slideshow_number']) {
                                $new_attachment_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post', get_the_ID());
                                if ($new_attachment_id) {
                                    $attachment_image = wp_get_attachment_image_src($new_attachment_id, 'blog-medium');
                                    $full_image = wp_get_attachment_image_src($new_attachment_id, 'full');
                                    $attachment_data = wp_get_attachment_metadata($new_attachment_id);
                                    $html .= '<li>
												<div class="image">
													<a href="' . get_permalink() . '"><img src="' . $attachment_image[0] . '" alt="' . get_post_field('post_excerpt', $new_attachment_id) . '" /></a>
													<a style="display:none;" href="' . $full_image[0] . '" rel="prettyPhoto[gallery' . get_the_ID() . ']" alt="' . get_post_field('post_excerpt', $new_attachment_id) . '" title="' . get_post_field('post_content', $new_attachment_id) . '"><img style="display:none;" alt="' . get_post_field('post_excerpt', $new_attachment_id) . '" /></a>

												</div>
											</li>';
                                }
                                $i++;
                            }
                        }
                        $html .= '</ul>
						</div>';
                    }
                }
            }
            $html .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>
			<div class="post-content">
			';
            if ($data['content_length'] == 'Excerpt') {
                // content of shortcodes should be displayed
                if (isset($atts['include_shortcodes']) && $atts['include_shortcodes'] == true) {
                    $html .= custom_excerpt();
                } else {
                    // content of shortcodes will be cut out, i.e. standard
                    $stripped_content = tf_content($data['excerpt_length_blog'], $data['strip_html_excerpt']);
                    $html .= $stripped_content;
                }
            } else {
                $html .= get_the_content('');
            }
            $html .= '</div><div class="clearboth"></div>';
        } else {
            $html .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
        }
        if ($data['post_meta']) {
            $html .= '<div class="meta-info">
					<div class="alignleft">' . __('By', 'Avada') . ' ';
            ob_start();
            the_author_posts_link();
            $html .= ob_get_clean() . '<span class="sep">|</span>' . get_the_time($data['date_format']) . '<span class="sep">|</span>';
            ob_start();
            the_category(', ');
            $html .= ob_get_clean();
            $html .= '<span class="sep">|</span>';
            ob_start();
            comments_popup_link(__('0 Comments', 'Avada'), __('1 Comment', 'Avada'), '% ' . __('Comments', 'Avada'));
            $html .= ob_get_clean() . '</div>
					<div class="alignright">
						<a href="' . get_permalink() . '" class="read-more">' . __('Read More', 'Avada') . '</a>
					</div>
				</div>';
        }
        $html .= '</div>';
    }
    $html .= '<div><div>';
    //no paging if only the latest posts are shown
    if (isset($get_latest) && $get_latest > 0) {
        wp_reset_query();
        return $html;
    } else {
        $html .= ml_blog_pagination($ml_query, $pages = '', $range = 2);
        wp_reset_query();
        return $html;
    }
}
Пример #29
0
                    echo $nonRegistered;
                    break;
            }
        }
        if ($cf_position[0] && !$jobTitle) {
            // then see if the legacy custom field for Position was used
            echo ', ' . $cf_position[0];
        } elseif ($jobTitle) {
            echo ', ' . $jobTitle;
        }
        ?>
                                    </span>
                                </header>
                                <article>
                                    <?php 
        custom_excerpt(40, ' [...]');
        ?>
                                    <footer>
                                        <?php 
        get_template_part('partials/addthis');
        ?>
                                    </footer>
                                </article>
                            </article>
                        <?php 
    }
    ?>
                    </section>
                <?php 
}
wp_reset_postdata();
 function media_center_post_excerpt()
 {
     global $post, $custom_query;
     $excerpt_length = 75;
     // Excerpt length
     $excerpt_length = isset($custom_query->query) && isset($custom_query->query['excerpt_length']) && $custom_query->query['excerpt_length'] ? $custom_query->query['excerpt_length'] : $excerpt_length;
     $read_more = __('Read More', 'media_center');
     $read_more_exclude = array('quote', 'link', 'status', 'aside');
     // post formats to exclude read more link
     $post_excerpt = '<p>' . custom_excerpt(get_the_excerpt(), $excerpt_length) . '</p>';
     if ($read_more != -1 && !in_array(get_post_format(), $read_more_exclude)) {
         $post_excerpt .= sprintf('<a href="%s" class="le-button huge btn">%s</a>', get_permalink(), $read_more);
     }
     return $post_excerpt;
 }