The easiest solution is probably to add a default image if no image can be found in the post. You can follow the instructions here to do so:
http://jetpack.me/2013/10/15/add-a-default-fallback-image-if-no-image/
2- Trough a filter only allow to show related posts that were posted after the year 2010
That’s also possible. You can specify a range to select Related Posts from. For example, to only display posts that are less than a year old:
function jetpackme_related_posts_past_year_only( $date_range, $post_id ) {
$date_range = array(
'from' => strtotime( '-1 year' ),
'to' => time(),
);
return $date_range;
}
add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_past_year_only' );
1- Somehow mess with the code and do not allow showing related posts without thumbnail
That’s also possible, although a bit more complicated. You should be able to sort Related Posts returned and exclude posts without any image thanks to the jetpack_relatedposts_returned_results
filter (#). However that won’t work if you’re already adding a default image to all posts.
I hope this helps.
Thanks Jeremy, I added a default image, it was easy.
I suggest adding “add a default image if no image can be found” to the “Customize Related Posts” page (http://jetpack.me/support/related-posts/customize-related-posts/)beacuse i searched everywhere and didn’t find http://jetpack.me/2013/10/15/add-a-default-fallback-image-if-no-image/ or my google-fu is weak 😉
Thanks again, you guys are the best .
I suggest adding “add a default image if no image can be found” to the “Customize Related Posts” page
Good idea. I just added a new section. Thanks for the suggestion!