Improved $paged variable code in the template.latest.php