Ok so the food was Najas. The narration you mentioned does not apply for all good deeds but specifically mentions prayers not being accepted for 40 days. This means one does not receive the thawab (reward) of their prayers during this time, although they still make them to fulfill their obligations. As for Ziyarat for every step you take towards this your sins are forgiven, so youre prayers would be answered inshallah