Created
August 4, 2014 14:19
-
-
Save richardmtl/a5c66b34454b55dc2ec4 to your computer and use it in GitHub Desktop.
Restrict Jetpack's Related Posts to a specific time-frame
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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