Cheers, thats just the sort of thing i was looking for.
i made one slight change to the ‘if is_home’ section, so that it will replace the existing posts_per_page rather than adding a second (which was getting ignored).
if you care, here is the code:
if ($query->is_home) {
if (preg_match("/posts_per_page=/", $query_string)) {
$query_string = preg_replace("/posts_per_page=[0-9]*/"
,"posts_per_page=$num_posts_on_home"
,$query_string);
} else {
if ($query_string != '') {
$query_string .= '&';
}
$query_string .= "posts_per_page=$num_posts_on_home";
}
}