Title: Show posts view count
Last modified: September 8, 2021

---

# Show posts view count

 *  Resolved [BlackBoXz](https://wordpress.org/support/users/blackboxz/)
 * (@blackboxz)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/show-posts-view-count/)
 * Hello,
    I found this below code to show view counts but I can’t get it to work
   in 1.5.2.
 * Is this code still valid?
 * Thank you for your response…
 *     ```
       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.
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Ketan Patel](https://wordpress.org/support/users/patelketan/)
 * (@patelketan)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/show-posts-view-count/#post-14858192)
 * Hello,
 * We have not understood your point please explain more explain.
 * Thanks,
 *  Thread Starter [BlackBoXz](https://wordpress.org/support/users/blackboxz/)
 * (@blackboxz)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/show-posts-view-count/#post-14859645)
 * Hello,
    This extra code is/was used to show/display **view counts** but this 
   isn’t working in 1.5.2 anymore.
 * What exactly you don’t understand?
 * See here also: [https://wordpress.org/support/topic/of-views-not-showing/](https://wordpress.org/support/topic/of-views-not-showing/)
 * Greetings,
 *  [Riddhi Shukla](https://wordpress.org/support/users/ridhimashukla/)
 * (@ridhimashukla)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/show-posts-view-count/#post-14869077)
 * Hi [@blackboxz](https://wordpress.org/support/users/blackboxz/) ,
 * Yes, you can place the same code to your template file. It will work for you.
 * Please check and let us know if anything.
 * Thank You!!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Show posts view count’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-trending-post-slider-and-widget_91aebb.
   svg)
 * [Trending/Popular Post Slider and Widget](https://wordpress.org/plugins/wp-trending-post-slider-and-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-trending-post-slider-and-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Riddhi Shukla](https://wordpress.org/support/users/ridhimashukla/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/show-posts-view-count/#post-14869077)
 * Status: resolved