How to narrow a closet door opening?
Instead of changing the size of the opening, use a pair of 24" doors in the "bypass door" configuration. They'll overlap 4" when closed and you'll have a 20" opening when they're open.

If you want to increase the 20" opening, you can cut the doors to make them narrower and this will still be less work than changing the size of the doorway. Even garbage MDF doors can be narrowed almost an inch on each side, especially if you're not attaching hinges or real doorknobs.