WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Dynamic Cached WP-PostViews (3 posts)

  1. Satiro
    Member
    Posted 2 years ago #

    Hi,
    I'm using WP-PostViews to show the number of views for each post on the homepage. I tried to make this number stays dynamic in this way:

    <!--mfunc the_views() -->
    <?php the_views() ?>
    <!--/mfunc-->

    But when I do a visit on a post and reload the homepage, it shows the same number (in the database the post's views increased by one). However the right number is showed on the post page and it doesn't have the code I wrote above. I'm using the PHP caching.

    What can I do?

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Have you tried editing the the_views() function and using wp_mail() or error_log() to verify it's being called?

    For performance reasons alone I wouldn't use a plugin like that. Every pageview will write to the database which is slow. You're better off using Google Analytics or WordPress.com Jetpack (or both!)

  3. Satiro
    Member
    Posted 2 years ago #

    Thanks for your suggestion!
    I installed jetpack, but how can I show the number of visits for each post? I can not find a function to do it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic