Example #1
0
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
    <?php 
        the_category('');
        ?>
    <div class="articles__meta">
      <p class="articles__date"><?php 
        the_time('Y年m月d日');
        ?>
</p>
      <p class="articles__views"><i class="fa fa-eye"></i><?php 
        echo wpp_get_views($post->ID);
        ?>
</p>
    </div>
  </div>
</div>
<?php 
    }
} else {
    ?>

<div class="alert">
<?php 
    if (is_search()) {
        $q = esc_html(get_search_query(false));
        ?>
Example #2
0
>
	<div class="post-meta">
		<div class="post-meta-item post-meta-cats"><?php 
one_category_colors();
//echo get_the_category_list( __( ', ', 'one_theme' ) );
?>
</div>
		<div class="post-meta-item post-meta-time"><?php 
the_date('l, F j, Y', '<time>', '</time>');
?>
</div>
		<?php 
if (function_exists('wpp_get_views')) {
    ?>
			<div class="post-meta-item post-meta-view-count"><i class="fa fa-eye"></i> <?php 
    echo wpp_get_views(get_the_ID());
    ?>
</div>
		<?php 
}
?>
	</div>
	<?php 
if (has_post_thumbnail()) {
    ?>
	<div class="post-image">
		<?php 
    the_post_thumbnail('large');
    ?>
	</div>
	<div class="post-image-content">
Example #3
0
function get_people_ranking($rang = 'all')
{
    $ame = get_term_by('slug', 'amenomori', 'people')->term_id;
    $people = get_terms('people', array('exclude' => $ame));
    $people_ranking = array();
    foreach ($people as $p) {
        if ($p->parent != 0) {
            $args = array('tax_query' => array(array('taxonomy' => 'people', 'field' => 'slug', 'terms' => $p->slug)));
            $ppost = get_posts($args);
            $views = 0;
            foreach ($ppost as $pt) {
                $views += wpp_get_views($pt->ID, $rang);
            }
            $pThumb = get_field('people_avatar', 'people' . '_' . $p->term_id);
            $ranking = array('term_id' => $p->term_id, 'term_name' => $p->name, 'term_thumb' => $pThumb, 'term_link' => get_term_link($p), 'view' => $views);
            array_push($people_ranking, $ranking);
        }
    }
    foreach ($people_ranking as $key => $value) {
        $key_id[$key] = $value['view'];
    }
    array_multisort($key_id, SORT_DESC, $people_ranking);
    $html = '';
    $rank = 0;
    foreach ($people_ranking as $list) {
        $rank = $rank + 1;
        if ($rank <= 5) {
            $thumb = $list['term_thumb'];
            $name = $list['term_name'];
            $link = $list['term_link'];
            $html .= '<li><a href="' . $link . '"><div class="thumb"><img src="' . $thumb . '"></div><div class="name">' . $name . '</div></a></li>';
        }
    }
    echo '<ul class="people-ranking">' . $html . '</ul>';
}