As others have already mentioned. Suggested causes for stinky/smelly compost:
1. Too Wet - needs more aeration. Adding more brown material and turning the pile on occasion will help alleviate odors.
2. Too much green - causes the pile to become wet and matted. Add more brown like dry leaves, pine needles, shredded newspaper etc.; try for a ratio of 3 parts brown, 1 part green.
3. Dairy, Meat - harbors bacteria and should not be added to a compost pile