Пример #1
0
        } else {
            $og_cdn_img = get_post_meta(get_the_ID(), 'original_thumbnail', true);
            // If custom field has value, use the CDN img
            if (!empty($og_cdn_img)) {
                echo '<img class="img-responsive" src="http://c767450.r50.cf2.rackcdn.com/img/video_thumbs/' . $og_cdn_img . '" />';
            }
        }
        ?>

                <div class="post-type font-weight-bold">
                  <i class="fa fa-play"></i>
                </div>

               <!-- <div class="views-count font-weight-bold">
                  <i class="fa fa-eye"></i> <?php 
        echo get_post_views();
        ?>
                </div> -->

                <!-- <div class="comment-count font-weight-bold">
                  <i class="fa fa-comments"></i> <?php 
        comments_number('0', '', '%');
        ?>
                </div> -->

              </figure>
              <figure class="media-body">

                <h2 class="entry-title font-size-medium font-weight-bold">
                  <?php 
        // Trim title
Пример #2
0
    function widget($args, $instance)
    {
        extract($args);
        /** Merge with defaults */
        $instance = wp_parse_args((array) $instance, $this->defaults);
        echo $before_widget;
        ?>
		
		<div class="rs-tabs-wrapper">
			<?php 
        if (!empty($instance['title'])) {
            ?>
				<h3 class="widget-title"><?php 
            _e($instance['title'], THEME_DOMAIN);
            ?>
</h3>
			<?php 
        }
        ?>
			
			<ul class="tabs list-unstyled clearfix">
				<li><a href="#tab-popular">Popular</a></li>
				<li><a href="#tab-recent">Recent</a></li>
			</ul>
			<div id="tab-popular" class="scroll-content">
				<ul class="tab-popular list-unstyled">
					<?php 
        $args = array('post_type' => 'post', 'post_count' => 5, 'meta_key' => '_post_view', 'orderby' => 'meta_value_num', 'order' => 'DESC');
        $popular_query = new WP_Query($args);
        if ($popular_query) {
            while ($popular_query->have_posts()) {
                $popular_query->the_post();
                ?>
									<li>
										<div class="row">
											<div class="col-xs-3 col-sm-3 col-md-3">
												<figure>
													<?php 
                $attr = array('class' => "blog-attachment-media", 'alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title())));
                echo get_the_post_thumbnail(get_the_ID(), apply_filters('popular_post_thumbnail_size', 'thumbnail'), $attr);
                ?>
												</figure>
											</div>
											<div class="col-xs-9 col-sm-9 col-md-9">
												<h4 class="popular-title mt0">
													<a href="<?php 
                esc_url(the_permalink());
                ?>
" title="<?php 
                echo esc_attr(get_the_title());
                ?>
">
														<?php 
                echo rs_truncate(get_the_title(), 50);
                ?>
													</a>
												</h4>
												
												<div class="views">
													<span class="post-views"><?php 
                echo get_post_views();
                ?>
</span>
												</div>
											</div>
										</div>
									</li>
								<?php 
            }
            /* Restore original Post Data */
            wp_reset_postdata();
        }
        ?>
				</ul>
				
			</div>
			<div id="tab-recent" class="scroll-content">
				<ul class="tab-recent list-unstyled">
					<?php 
        $args = array('post_type' => 'post', 'post_count' => 5);
        $recent_query = new WP_Query($args);
        if ($recent_query) {
            while ($recent_query->have_posts()) {
                $recent_query->the_post();
                ?>
									<li>
										<div class="row">
											<div class="col-xs-3 col-sm-3 col-md-3">
												<figure>
													<?php 
                $attr = array('class' => "blog-attachment-media", 'alt' => trim(strip_tags(get_the_title())), 'title' => trim(strip_tags(get_the_title())));
                echo get_the_post_thumbnail(get_the_ID(), apply_filters('recent_post_thumbnail_size', 'thumbnail'), $attr);
                ?>
												</figure>
											</div>
											<div class="col-xs-9 col-sm-9 col-md-9">
												<h4 class="recent-title mt0">
													<a href="<?php 
                esc_url(the_permalink());
                ?>
" title="<?php 
                echo esc_attr(get_the_title());
                ?>
">
														<?php 
                echo rs_truncate(get_the_title(), 50);
                ?>
													</a>
												</h4>
												
												<div class="date">
													<span class="date-posted"><?php 
                the_time('F j, Y');
                ?>
</span>
												</div>
											</div>
										</div>
											
									</li>
								<?php 
            }
            /* Restore original Post Data */
            wp_reset_postdata();
        }
        ?>
				</ul>
			</div>
		</div>
		<?php 
        echo $after_widget;
    }
Пример #3
0
    ?>
">
                      <input type="hidden" name="send_like" value="send-like">
                      <a href="#" class="like_request"><i class="fa fa-heart"></i></a>
                  </div>
              </form>
          <?php 
} else {
    ?>
              <!-- <i class="fa fa-heart" style="color: #f24949;"></i> -->
          <?php 
}
?>
          <?php 
set_post_views($post->ID);
echo get_post_views($post->ID);
?>
				</div>
				<div class="clear"></div>
					</div>
				</div>	
			</div>
		</div>


			<!-- RELATED POSTS -->

			<div class="curator-detail-wrap article-detail-wrap related-posts">

				<div class="detail-title">
						<h2 class="article-title">Yet Another Related Posts</h2>
Пример #4
0
function get_post_year_robotpreviews()
{
    return get_post_views('robot', 'year', 'excerpt');
}
Пример #5
-1
        public static function ranking_article_func()
        {
            ob_start();
            ?>

		<div class="sideboxcontent rankwrap">

			<h3 class="sidetitle">Ranking Article</h3>
			<ul class="rankarticle list-articles">

				<?php 
            $args = array('post_type' => 'acme_article', 'posts_per_page' => 5, 'meta_key' => 'post_views_count', 'orderby' => 'meta_value_num', 'order' => 'DESC');
            query_posts($args);
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
				<li>
					<a href="<?php 
                    echo get_permalink();
                    ?>
">
						<span class="rank rank1">1</span>
						<?php 
                    global $wp_query;
                    $post = $wp_query->post;
                    //var_dump($post);
                    ?>
						<div class="siderankimage"style="background-image:url(<?php 
                    echo getArticleImage($post->ID);
                    ?>
); background-position: center;"></div>
						<h4 class="ranktitle"><?php 
                    if (strlen($post->post_title) > 10) {
                        echo mb_strimwidth(the_title($before = '', $after = '', FALSE), 0, 10) . '...';
                    } else {
                        the_title();
                    }
                    ?>
</h4>
						<span class="smallpoints smallpoints-right"><?php 
                    echo get_post_views($post->ID);
                    ?>
</span>
				</li>
			<?php 
                }
            }
            wp_reset_query();
            ?>
	
			</ul>
		</div>
			
		<?php 
            return ob_get_clean();
        }