コード例 #1
0
ファイル: content.php プロジェクト: ask4kapil/ask4kapil-theme
            <div class="blog-posts <?php 
if (is_single()) {
    echo "single-page";
}
?>
" >
                <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
                    <article id="post-<?php 
        echo $post->ID;
        ?>
" class="post-item post-count-<?php 
        echo ask_get_post_view($post->ID);
        ?>
 post-<?php 
        echo $post->ID;
        ?>
 post type-post status-publish format-standard hentry category-<?php 
        echo $post->post_category;
        ?>
" data-scroll-reveal="">
                        <div class="post-bullet">
                            <i class="fa fa-circle"></i>
                        </div>
                        <figure class="featured-image">
                            <a href="<?php 
        the_permalink();
        ?>
コード例 #2
0
/**
 * Display the number of views for each posts
 *
 * @param $column_name
 * @param $id
 *
 * @return void simply echo out the number of views
 */
function ask_posts_custom_column_views($column_name, $id)
{
    if ($column_name === 'post_views') {
        echo ask_get_post_view(get_the_ID());
    }
}