Arduino Wifi Shield together with LCD Display Shield

I was also having trouble using the Arduino WiFi shield and a LCD as it needed to use the same pins. But I figure out I could use both by using a Mega 2560. The examples page on Arduino.cc of LCD's show that the display needs to use digital pins 5, 4, 3 and 2 for data. But the WiFi shield needs pin 4 for SD card. Also pins 12 and 13 are different on the Mega from the Uno. So the only thing I had to change was move the wire from digital pin 4, to any other pin (I chose 22) and put it in the code. This let me use both at once.