Tissues inside the nose become swollen and secretions are increased, both of which alter airflow through the nose. Adequate air has to flow to the upper 'narrow' recesses of the nose to reach the nerves for detection of odors. Without air reaching this area, one has little to no detection of odors. Smell and taste information is integrated together in the brain so lack of information about odors often diminishes our taste perception.
The solution is treatment of the underlying recurrent infection problem. Sometimes that may include surgical procedures that improve airflow inside the nose.