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.
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
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.
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’ );`
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.