Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6293
    Female Perversions
    Participant

    My site uses the Pieces theme, and I’m trying to figure out how to integrate the view count inside of the gray box that falls under each post excerpt, under the tag listing.

    I figure it’s simply a matter of editing content.php, but while I have a basic idea of where it should go, I have no real clue about what functions and shortcodes I’m supposed to using. I believe the relevant code is as follows.

    <footer class="entry-meta entry-footer">
    		<?php if ( 'post' == get_post_type() ) : ?>
    			<?php
    				$categories_list = get_the_category_list( __( ', ', 'nuthemes' ) );
    				if ( $categories_list && nuthemes_categorized_blog() ) :
    			?>
    			<span class="cat-links">
    				<?php printf( __( '%1$s', 'nuthemes' ), $categories_list ); ?>
    			</span>
    			<?php endif; ?>
    
    			<?php
    				$tags_list = get_the_tag_list( '', __( ', ', 'nuthemes' ) );
    				if ( $tags_list ) :
    			?>
    			<span class="tags-links">
    				<?php printf( __( '%1$s', 'nuthemes' ), $tags_list ); ?>
    			</span>
    			<?php endif; ?>
    		<?php endif; ?>

    Any help would be much appreciated.

    #6294
    Bartosz
    Keymaster

    Hi,

    You have 2 functions available:
    pvc_post_views() – to get and display views count
    pvc_get_post_views() – te get views count and do anything with it

    You don’t have to use any additional parameters, plugin detect the current post you’re on. But if you’d like to get views for a specific post just use post ID in the function like this: pvc_post_views(123) where 123 is the ID of the post.

    #6298
    Female Perversions
    Participant

    Thank you, but how would I actually call the function?

    My first thought was to check content-single.php to see how the view count is being called in by your plug-in, but I cannot find a single reference to it anywhere.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.