there could be a few things going on. first yogurt and baby food is more easily digestible than pizza or other solid food high in fat. it could be he got sick and it's just taking time to get back to his regular diet. if he still can't keep food down (it has been three days since your post) see his doctor asap. for more on potential causes and remedies see this article.
why is my toddler throwing up after eating solid foods. he was diagnosed with croup a few days ago and i thought he had the flu yesterday but he has been able to eat baby food or yogurt and be ok when i feed him solid foods like pizza for example he has been throwing up within 5 minutes of eating it. he has always been able to eat solid foods just fine until a few days ago. he is 22 months old.