Replies: 0
Hello,
I’ve setup JetPack related posts and limited them to only 48 hours using this code added in functions.php (following the example in the documentation):
function g4m_related_posts_past_2_days_only( $date_range ) {
$date_range = array(
'from' => strtotime( '-48 hours' ),
'to' => time(),
);
return $date_range;
}
add_filter( 'jetpack_relatedposts_filter_date_range', 'g4m_related_posts_past_2_days_only' );
I’ve also tried with ‘-2 days’ and it still doesn’t work. Basically, it shows results which are far older than 2 days. Is there any limitation around this? This is a news site and it doesn’t make any sense showing news which are 2-3 weeks old.
Thank you!
Pedro