Add support for checking whether the loop is for the home page or a single page and change a few things accordingly.