Support » Plugin: Jetpack by » Add date to related posts

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Richard Archambault


    Happiness Engineer

    Try this to limit the age:

    function jetpackme_related_posts_past_year_only( $date_range ) {
        $date_range = array(
            'from' => strtotime( '-2 months' ),
            'to' => time(),
        return $date_range;
    add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_past_year_only' );

    Note that the actual filter for date ranges will only be accurate down to the month for caching purposes; this filter is not really designed for fine grained control! So if you say you only want posts from March 2012 onwards it may actually include some posts from late Feb 2012 as well in the results.

    Asof ro showing the date, no, there is no way that I know of for doing that. I have opened an enhancement request for that:

    Thank you. I will try it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add date to related posts’ is closed to new replies.