Source file: modules/related-posts/jetpack-related-posts.php
View in GitHubParameters
- $args[’date_range’]
-
(array) Array of a month interval where we search Related Posts.
- $post_id
-
(string) Post ID of the post for which we are retrieving Related Posts.
Changelog
Since: Jetpack 2.8.0
Notes
In the example below, we use the filter to only return posts from the past 6 months:
function jetpackme_related_posts_past_halfyear_only( $date_range ) { $date_range = array( 'from' => strtotime( '-6 months' ), 'to' => time(), ); return $date_range; } add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_past_halfyear_only' );
Have a question?
Comments are closed for this article, but we're still here to help! Visit the support forum and we'll be happy to answer any questions.
View support forum