In this diagram multiple ground fault circuit interrupter receptacles are wired together using pigtails. Two-conductor cable is run between gfci’s, and the hot, neutral and ground wires from the source are spliced to the line terminals at each device. The load terminals are not used and each device provides its own, single-location protection.
Splice both the fan and the light hot wires together with the common wire from the SW2. The traveler wires are spliced together in the ceiling fixture box. To control the fan and light separately, a builtin switch such as a pull chain or remote control is required on the fan/light.
The black cable wire is connected to the top terminal on the switch and spliced to the black and blue wires at the fan at the other end. The neutral source and ground are spliced through to the white and ground connections at the fan.
In this wiring, the source is at the switch and 3-wire cable runs from there to the fan/light. The switch controls the light and the source is spliced through to the fan. With this arrangement, the fan is controlled by a pull-chain on the motor housing and the light is controlled with the switch. The neutral and ground wires are also spliced through to the fan/light.