Update _story-header.php to shows views count

This commit is contained in:
Nabeel Shar 2023-12-28 00:10:42 +05:00 committed by GitHub
parent 799cef82dd
commit 6acc78524c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,12 +61,21 @@ if ( ! $thumbnail_shown ) {
<?php endif; ?>
<div class="story__identity">
<h1 class="story__identity-title"><?php echo $story['title']; ?></h1>
<h1 class="story__identity-title"><?php echo $story['title'];
?></h1> <?php
$views = get_post_views(get_the_ID());
echo '<i class="fas fa-eye" style="font-size: 14px;"> ' . $views . '</i>';
?>
<div class="story__identity-meta"><?php
printf(
_x( 'by %s', 'Story page: by {Author(s)}', 'fictioneer' ),
fictioneer_get_story_author_nodes( $story_id )
);
?></div>
</div>