To properly hang a folding attic stairway that is smaller than the available opening you’ll need to first measure the width of the opening and then subtract the outer dimensions of the door. By dividing that number in half you’ll get the thickness of spacer needed for each side side of the opening.
If possible, the hinge end of the attic door should be attached directly to the framing so the spacers can go on the opposite end. Adding a temporary cleat below the finished door location will help you support the door while you drive the screws to secure it in place.
Depending on the ceiling height, the ladder may need to be adjusted to rest at the proper angle. This aluminum ladder has adjustable feet so we simply cut off a few inches of the ladder and slide the feet up before securing them.
Rather than fill the voids around the door face we are adding a new skin to the door by gluing and tacking a larger piece of quarter inch plywood on top of the old door.