• Hi thank you for this great plugin. I don’t know what happened it stopped counting the post views. Can you please help me?

    • This topic was modified 2 years, 1 month ago by turansaim.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Pavan Kumar

    (@southindianjobs1)

    I am facing the same problem too. The screen options in the dashboard do not show the post-view plugin option. All the previous post counts on the dashboard are not visible.

    Reference Image

    • This reply was modified 2 years, 1 month ago by Pavan Kumar.

    I have same problem. I have archive page where is all posts and I see 0 to every post but when I open post I see views. here is url: https://www.skystory.sk/aktuality/

    If you are using a shortcode, the temporary workaround would be to use the pvc_post_views_html filter like this:

    add_filter( 'pvc_post_views_html', 'custom_pvc_post_views_html', 10, 5 );
    /**
     * It replaces the number of views in the Post Views Counter plugin with the number of views in the
     * Post Views plugin
     * 
     * @param html The HTML to be filtered.
     * 
     * @return the html.
     */
    function custom_pvc_post_views_html( $html ) {
    	if ( ! function_exists( 'pvc_get_post_views' ) ) {
    		return $html;
    	}
    
    	$views = pvc_get_post_views();
    
    	$html = preg_replace( '/<span class="post-views-count">(.*?)<\/span>/', '<span class="post-views-count">' . $views . '</span>', $html );
    
    	return $html;
    }

    The alternative option would be to use the pvc_get_post_views() function instead of do_shortcode() and pass a post ID to it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Doesn’t count’ is closed to new replies.