Sometimes you would like to add a specific featured image to post if it belongs to a specific category. You would like the posts from one category to display an image when it does not have an image attachment with itself, so if an author leaves out or forgets a to put a featured image, you don’t have a blank image for that post and a category image is displayed automatically. This can be done very easily in wordpress. Here are the steps
1-First save images or icons for each category with their name. For example for news category save a picture news.png, for economy category save economy.png and so on. Save all of them in images folder of your active theme.
2-Then in your template files where ever you want to show featured images write this code.