The Bluebirds midfielder arrowed his first goal into the bottom corner a minute into the second half to haul the Welsh club back from two goals down and then curled home a sublime free-kick to leave the rockbottom Robins without a win in their last six league matches.
Keith Millen's side had turned the formbook upside down early in the first half by roaring into a two-goal lead in the first eight minutes thanks to efforts from on-loan Tottenham teenager Steve Caulker and Jon Stead, before Jay Bothroyd pulled one back for the home side.
Cardiff have now won three of their last four league encounters and stay second in the table.
Michael Chopra returned for Cardiff after a two-month lay-off due to ankle ligament damage, but there was no Craig Bellamy, who has ongoing knee trouble.
New dad Danny Haynes returned for the visitors to partner Stead in attack, but it was defender Caulker who ensured the Robins made a flying start, rising highest at the far post to head home Jamie McAllister's left-wing cross in the sixth minute.
The visitors stunned the home faithful two minutes later when they doubled their lead from another set-piece.
Marvin Elliott headed on Cole Skuse's corner and when the ball broke to Stead six yards out the big striker lashed the ball into the top corner for his third goal of the season.
But in a storming start Bothroyd settled home nerves in the 12th minute, applying a clinical finish from 12 yards after collecting Chopra's ball into the penalty area.
Bothroyd forced a fine save from former England goalkeeper David James shortly before the break and Mark Hudson headed Whittingham's corner just over the crossbar.
But Cardiff were rewarded for their pressure just a minute into the second half thanks to a stunning effort from Whittingham, who rifled the ball into the bottom corner from 30 yards.
James pulled off another top-class save to keep out Chris Burke's close range effort, but the visitors still carried a threat on the counter-attack.
McAllister's 30-yard bullet was save tipped round the post by Cardiff goalkeeper Tom Heaton and Albert Adomah's angled shot was blocked by defender Gabor Gyepes.
Bothroyd volleyed wide from close range and Whittingham pulled his effort wide as Cardiff chased a third goal before the Robins responded again through midfielder Elliott, whose thumping drive was brilliantly kept out by Heaton.
But Cardiff maintained their momentum and edged their noses in front in the 78th minute.
Visiting skipper Louis Carey fouled Whittingham 25 yards from goal and the Cardiff midfielder picked himself up to curl the subsequent free-kick beyond the flailing James into the top corner.
Caulker then headed narrowly wide at the other end as the Robins tried to salvage a point, but despite Danny Rose's superb 30-yard volley, Cardiff closed the game out comfortably, with successive shots from substitute Jason Koumas blocked by visiting defender Liam Fontaine.