Measure the width of your opening, subtract one inch, and record your finding. Cut two of the 2-by-4-inch pieces of lumber to this measurement. Determine how many 1-by-6-inch pieces of lumber you need to fill in the space.
Space the 2-by-4-inch lumber apart from each other so that, when you place one of the pickets on them, there will be four inches of the picket hanging over at the top and bottom. Center the pickets on the 2-by-4s and secure them with the deck screws through the picket and into the frame.
Turn the gate over and lay a 2-by-4 from the top inside corner of the frame to the bottom inside corner. Draw a line where the lumber lays on the 2-by-4s in Step 2.
Cut the lines so that when you place the lumber on the gate, it will fit between the lumber in Step 2 and create a "Z". Secure it to the other 2-by-4s with the 1½-inch drywall screws. Next, turn the gate over and secure the pickets where they cross over the 2-by-4 cut on an angle.
Install the gate hinges to the gate to the top and bottom of the 2-by-4-inch frame. Use lag screws that are at least 1¼-inches long on the gate and longer ones for the post the gate will swing on.