예제 #1
0
    function gazeta_post_meta($content)
    {
        global $post;
        if (!isset($post->ID) || get_post_type($post) != 'post' && !is_single() && is_main_query()) {
            return $content;
        }
        ob_start();
        ?>
			<div class="ns-meta entry-meta">
				<div class="nsm-inner">
					<span><i class="fa fa-clock-o"></i> <a href="<?php 
        print gazeta_get_post_archive_link($post->ID);
        ?>
"><?php 
        print get_the_date();
        ?>
</a></span>
					<?php 
        if (get_comments_number()) {
            ?>
						<span><a href="<?php 
            comments_link();
            ?>
"><i class="fa fa-comments"></i> <?php 
            print get_comments_number();
            ?>
</a></span>
					<?php 
            if (gazeta_get_post_views($post->ID) > 0) {
                ?>
						<span><i class="fa fa-eye"></i> <?php 
                print gazeta_get_post_views($post->ID);
                ?>
</span>
					<?php 
            }
            ?>
					<?php 
        }
        ?>
					<?php 
        do_action('gazeta_post_meta/meta');
        ?>
				</div>
			</div>
		<?php 
        return $content . ob_get_clean();
    }
예제 #2
0
 function gazeta_get_post_views_text($post_id)
 {
     if (!$post_id || gazeta_get_post_views($post_id) == 0) {
         return;
     }
     if (gazeta_get_post_views($post_id) == 1) {
         return __('1 View', 'gazeta');
     } else {
         return sprintf(__('%s Views', 'gazeta'), gazeta_get_post_views($post_id));
     }
 }