"In the post-independence era riddled with social unrest, ~~."
To make this phrase grammatically correct, do I need to switch "the" to "a"?
Or does it not matter?
If yes, would you please explain why?
Thanks
No. "the" is used to point to a specific era. If you changed to "a", you would change the meaning to one of many eras - It could be any of a number of eras.