I just found out my landlord is not paying the mortgage. Do I still have to pay rent?

The rent is still due regardless of the loan status. As long as you are receiving the benefit of the occupancy as outlined in your lease/rental agreement, then you are obligated to pay the agreed upon amount. Even if a landlord is in foreclosure, they can still evict you for non-payment of rent. Many renters stop paying rent when they find out about the foreclosure because they do not believe that the landlord will pursue an eviction if they are losing the house anyway. Keep in mind that sometimes a landlord may be in foreclosure, but actively pursuing a modification of the loan terms. In this case they are working to correct the issue and any loss of rent may impact their ability to receive a modification.