• Resolved creationbeaudoin

    (@creationbeaudoin)


    Hi,

    I use Wp-Rocket and with Wpp installed I cannot see updated views count on post when i’m refreshing the post. I need to clear cache each time i want to see the new count.

    I have excluded in Wp-Rocket this /wordpress-popular-posts/assets/js/ but it doesn’t work.

    I also have checked Ajaxify widget in wpp tools to disable your plugin from being cached by wp-rocket but it’s not working too.

    Thanks for your help!

    Have a good day!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @creationbeaudoin,

    I cannot see updated views count on post when i’m refreshing the post.

    What do you mean exactly with this? Feel free to share a screenshot or a video so I can see what’s going on.

    Thread Starter creationbeaudoin

    (@creationbeaudoin)

    Yes, here the screenshot https://ibb.co/MGnQ0S0

    Numbers don’t want to update when I refresh the post. I need to clear wp-rocket cache. How can I exclude wpp from being cache by Wp-Rocket

    Plugin Author Hector Cabrera

    (@hcabrera)

    Thanks for the screenshot, @creationbeaudoin.

    That view icon isn’t something coming from WordPress Popular Posts. It’s very likely a theme functionality.

    Please reach out to your theme developer and check with them whether it’s possible to load the views icon + count (or at least the views count) via AJAX so it doesn’t get cached by WP Rocket.

    Thread Starter creationbeaudoin

    (@creationbeaudoin)

    I have been using your code to make a shortcode for a count views on my website. It is not possible to add ajax functions in there? I’m using astra theme. I’m not really a developper.

    /**
    * Registers the shortcode [wpp_views_count].
    *
    * @author Hector Cabrera (https://cabrerahector.com)
    * @return string
    */
    function wpp_views_count_func() {
    if (
    function_exists(‘wpp_get_views’)
    && is_single()
    ) {
    $views_count = wpp_get_views( get_the_ID() );
    return ($views_count == 1) ? ‘1 vue’ : $views_count . ‘ vues’;
    }

    return ”;
    }
    add_shortcode( ‘wpp_views_count’, ‘wpp_views_count_func’ );`

    Plugin Author Hector Cabrera

    (@hcabrera)

    Yes, it’s possible. However that requires a bit of custom coding work (you’ll likely need to modify at least a couple of theme files to implement this) which falls outside of the scope of support I provide here (answering plugin feature requests & bug reports, general questions about the plugin, etc.)

    If this is beyond your current skills you may want to consider hiring a developer for this (via WP Jobs for example) or -as I suggested earlier- checking with the Astra theme developers and see if they can lend you a hand with this.

    Thread Starter creationbeaudoin

    (@creationbeaudoin)

    ok thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wp-Rocket Caching’ is closed to new replies.