Measure and note the height of the opening between the first two posts. Subtract 1/4 inch from that dimension to calculate the length of the vertical stiles of the frame. Measure and mark two 2-by-2-inch boards to that length. Double-check the measurements to make sure the marks are correct.
Trim the boards on a chop saw that's set to make 90-degree cuts. These boards form the vertical framing members.
Drill pilot holes in each board, centered about 1 inch from each end and about 10 inches apart down the middle of the boards.
Position the first board against one side post between the upper and lower rails. Center the board horizontally on the post. Using a drill and driving bit, screw the board to the post with coated wood screws. Attach the second vertical framing member to the post on the opposite side of the opening.
Measure and note the horizontal distance between the installed vertical pieces of the frame. Subtract 1/4 inch from that dimension to calculate the length of the horizontal framing members. Measure, mark and cut two boards to that length to form the horizontal framing members.
Drill pilot holes that are centered about 1 inch from the ends of the boards and about 10 inches apart across the middle of the boards.
Position one board on the lower rail and screw it into place.
Lay the upper rail-board on a flat surface. Insert one screw into each pilot hole. Manually turn each screw just enough to hold them in place. Position the board on the underside of the upper rail, then screw it in place.
Measure the outer dimensions of the new frame and subtract 1/2 inch from the height and length. Outline the the dimensions on the lattice panel, using a yardstick and a permanent marker. Use a jigsaw to trim the lattice panel along the cutting lines.
Position the panel vertically, centered to the installed frame. Attach the upper corners of the lattice to the frame with lattice screws. Continue attaching the lattice to the frame with screws, evenly spaced, about 6 inches apart.