• Resolved seanpaulfx

    (@seanpaulfx)


    Hello
    The plugin counts all the pages that a user visits.
    I want it to work only in posts.
    Do you have any code to help me do that, thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    There isn’t a way to stop the tracking by post type but when creating the popular posts you can only include the post types you want.

    Thread Starter seanpaulfx

    (@seanpaulfx)

    How can I exclude posts by the code below.

    	$settings = array(
    		'daily' => TRUE,
    		'daily_range' => 30,
    		'limit' => 20,
    		'strict_limit' => FALSE,
    
    	);
    	$topposts = get_tptn_pop_posts( $settings ); // Array of posts
    	$topposts = wp_list_pluck( (array) $topposts, 'postnumber' );
    // args
    	$toppost_args = array(
    		'post__in' => $topposts,
    		'orderby' => 'post__in',
    		'posts_per_page' => 10,
    		'post__not_in' => array(6828),
    		'ignore_sticky_posts' => 1,
    
    );

    I tried post__not_in But it does not work.

    I have added the article id in the section: Exclude display on these post IDs
    It also does not work.

    Thanks

    • This reply was modified 4 years, 7 months ago by seanpaulfx.
    Plugin Author Ajay

    (@ajay)

    For $settings, you can also use the post_types attribute with a comma separated list of post types.

    The shortcode parameters work here: https://webberzone.com/support/knowledgebase/top-10-shortcodes/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only count the article hits’ is closed to new replies.