To figure out whether you are on the home page or not, the following code will help:

How to know if you are on the home page
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: