You can choose to take a bus from Pingyao to Jiexiu, and then take the bus 1 1 to Wang Jia compound directly.
You can also choose to take the train from Pingyao, get off at Jiexiu or Lingshi Railway Station, and then take Lingshi bus to Wang Jia Courtyard.