Viewing 1 replies (of 1 total)
  • Plugin Author Justin Sternberg

    (@jtsternberg)

    You can use the new filter, gtc_should_display_item to filter out the posts you want (based on any metric).

    e.g.

    
    function gtc_remove_unless_older( $show, $item, $atts ) {
    	if ( isset( $item['post']->post_date ) ) {
    		$post_time_stamp = strtotime( $item['post']->post_date );
    		$week_ago = time() - ( DAY_IN_SECONDS * 7 );
    
    		// Only show if the post time stamp is older than a week ago.
    		$show = $post_time_stamp < $week_ago;
    	}
    
    	return $show;
    }
    add_filter( 'gtc_should_display_item', 'gtc_remove_unless_older', 10, 3 );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Exclude post by certain number day.’ is closed to new replies.