There are a number of different ways to insert an opening into the back of your cushion. Because I am using different weight fabrics in the two pieces, hemp and cotton, I find that this method is simple and works well.
I cut my backing piece using the measurements below.
I then measure down approx. 4" and cut across the width so that there are two pieces. Marking the middle I then add my zipper using the same method used in making pouches. (tutorial here.) I leave the seam 2" on each end of the zipper open.
Then turn down a pleat in the fabric and pin in position.
I then sew along the pin line. Here I have used a darker thread so that the stitching can be seen. This closes the ends of the fabric and the zipper sits inside the fold of fabric.
I then trim back the excess fabric so that the front and back pieces are the same size. Placing the right sides together I pin the two pieces together, making sure I open the zipper first. Because I used a dark thread that would show I forgot that this wouldn't be visable on back of the front panel. So Here I have tacked it in position. Usually you can see this stitching and use it as your guide when stitching the front and back together. Use your zipper foot again to do this and run your finger down the side of the piping cord so that it sits proud and stitch on top of the line where you attached to piping to the front panel.
Because I am using hemp fabric for the front panel I have to make my seam allowances a bit bigger, about 3/4". (If I didn't do this it could fray.) And, also because of the hemp I have to neaten the edges with a wave stitch. (If I used the overlocker I could do damage to the cutting blade.)
Turn your work through and add your pillow insert, go up to the next size if you want the cushion to be plump. I have left the dark thread in place so that you can see the stitching on the back. With a self coloured thread you wouldn't see this.
The pillow front is an old Kogin kit I finished ages ago . It isn't my best stitching but works well as a sample for showing how to put piping around a cushion.