Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Sorry for the inconvenience.
    This functionality is not available to show view count.

    Thanks

    Thread Starter KimMcDougalcrafter

    (@ormgrecipes)

    I saw in the description of the plugin that this shortcode can be used to show views:
    [wtpsw_popular_post view_by=”views”] (Display Post list by Views or Comment count. You can use “views” OR “comment_count”)

    Is that only in the Pro version?

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    We have the functionality to display post ‘view’ wise and ‘comment_count’ wise but there is no functionality available to display ‘view’ count.

    But you want to show view count you can use this custom code to display view count

    <?php echo get_post_meta( $post->ID, WTPSW_META_PREFIX.'views', true ); ?>

    Suppose you are using this shortcode [wtpsw_popular_post view_by="views"] then you have to add this code in wp-trending-post-slider-and-widget/templates/slider/design-1.php file where you want.

    Thanks.

    Thread Starter KimMcDougalcrafter

    (@ormgrecipes)

    Thank you, I’ll give it a try.

    Thread Starter KimMcDougalcrafter

    (@ormgrecipes)

    Sorry to have to ask another question…I got the code working and it’s counting the views but how do I add the word “# of Views:” just before the number so a person knows what it is? Right now this is the way it looks: date / 0 Comments 11

    How can I get it look like this? date / 0 Comments / # of Views: 11

    And thank you so much for the time you’re taking helping me!

    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Ok, I Give you exact and proper code please undo all which you previously modified.

    Go to line no 39 of wp-trending-post-slider-and-widget/templates/slider/design-1.php and put this code

    
    <?php 
    $views = get_post_meta( $post->ID, WTPSW_META_PREFIX.'views', true );
    $views = !empty($views)?$views:0;
    $wtpsw_post_stats[] = "<span class='wtpsw-post-comment'># of Views: ".get_post_meta( $post->ID, WTPSW_META_PREFIX.'views', true )."</span>";
    ?>	

    Note:- Your modified code will lose when the plugin will update.
    if you face error then write manually do not copy and paste may be causing quote (”) issue.

    • This reply was modified 6 years, 3 months ago by Anoop Ranawat.
    Plugin Author Anoop Ranawat

    (@anoopranawat)

    Hello,

    Please give us review and rate if you like our plugin and support.

    Thanks.

    Thread Starter KimMcDougalcrafter

    (@ormgrecipes)

    Excellent!!!! Just what I needed, you are a gem! I will definitely rate this plugin and marking this as resolved. Thank you again so much for helping me!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘# of Views Not Showing’ is closed to new replies.