Skip to content

Instantly share code, notes, and snippets.

@richardmtl
Created August 4, 2014 14:19
Show Gist options
  • Save richardmtl/a5c66b34454b55dc2ec4 to your computer and use it in GitHub Desktop.
Save richardmtl/a5c66b34454b55dc2ec4 to your computer and use it in GitHub Desktop.
Restrict Jetpack's Related Posts to a specific time-frame
function jetpackme_related_posts_date_restricted( $date_range, $post_id ) {
// We can change this based on $post_id too but let's just filter everything
$date_range = array(
'from' => strtotime( '1 January 2013' ),
'to' => time(),
);
return $date_range;
}
add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_date_restricted' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment