Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    You’d need to customize the output of the shortcode to achieve that. In addition of the plugin, you’ll need to add the following code snippet to a functionality plugin on your site:

    
    /**
     * Do not output anything if there are less than 1,000 views.
     *
     * @see https://www.ads-software.com/support/topic/hide-counter-if-less-than-100-views/
     *
     * @param string $view    Phrase outputting the number of views.
     * @param array  $views   Number of views.
     * @param string $post_id Post ID.
     */
    function jeherve_limit_post_views_thousands( $view, $views, $post_id ) {
    	if ( 1000 > (int) $views['total'] ) {
    		return '';
    	}
    
    	return $view;
    }
    add_filter( 'jp_post_views_output', 'jeherve_limit_post_views_thousands', 10, 3 );
    
    Thread Starter superjak

    (@superjak)

    It’s perfect thank you so much ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide counter if less than 100 views’ is closed to new replies.