Is there a way for my iphone to not disconnect from my Wi-Fi when put into lock mode?

Is there a way for my iphone to not disconnect from my Wi-Fi when put into lock mode?

When you put your iPhone in Airplane mode from settings, go back into Wi-Fi and turn it back on. This will leave the phone connected to Wi-Fi but not cell service. If you mean when in complete lock mode, it is still in Wi-Fi mode but you can't access it until you unlock the phone. The display may initially not show it there, but it should show up shortly or when you try to run something that uses the internet.