How to turn off calls, iMessage and texts, but stay on Wifi?
By removing the SIM card, you'll disable (phone)calls, sms/mms and data (Edge, 3G and 4G/LTE)
To disable iMessage, you've to open settings-> Messages and then swipe the iMessage option to off.
Put your phone in Airplane mode, then turn on Wifi. This disables the cell network, but enables wifi.
Messages will continue to work, but phone calls will not. If you have Wifi calling enabled, phone calls will continue to get through, depending on your service provider.
To disable Messages, simply go to the Messages section of Settings, and move the slider to the left.