Yeah, the opening post should really mention that regardless of what build you have, stock Nougat on Moto G4 requires a custom kernel to root without issue.
So you've booted your device to TWRP (leaving it on the TWRP main menu), and yet you don't see your device when you've connected it to your computer via USB? Have you got the minimal adb/fastboot drivers on your computer still (I assume so as you've installed TWRP)? Can you take your SD card out and try booting again?
If you can't see your internal storage, you may wish to try re-flashing the stock ROM. I don't know what build you had previously, though the latest stock ROM is the June 2017 stock ROM: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 If you can remember your stock ROM security patch level or build, we could give you more tailored advice, or you may wish to flash the latest stock ROM anyway.
Assuming that you have adb/fastboot still:
Reboot your device to the bootloader.
Attach your device to your computer
In the adb terminal, verify your device is communicating by typing 'fastboot devices' in adb (without quotes), it should return your device serial code.
If communicating, you can use the following commands in the adb terminal to update your device, it'll replace TWRP and any other modifications with stock and should not lock your bootloader. It should not affect your data but be prepared to factory reset if your device is not stable:
Code:fastboot flash partition gpt.bin fastboot flash bootloader bootloader.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash dsp adspso.bin fastboot flash oem oem.img fastboot flash system system.img_sparsechunk.0 fastboot flash system system.img_sparsechunk.1 fastboot flash system system.img_sparsechunk.2 fastboot flash system system.img_sparsechunk.3 fastboot flash system system.img_sparsechunk.4 fastboot flash system system.img_sparsechunk.5 fastboot flash system system.img_sparsechunk.6 fastboot flash system system.img_sparsechunk.7 fastboot flash modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn fastboot erase cache fastboot reboot
THANK YOU! It was possible to add kernel while in TWRP, I only tried while in bootloader. I installed the kernel and my phone works again.
After that I backed up and installed the root.zip folder again.
But root checker says I still have not rooted the phone properly. But I can give superuser permissions to apps?. After all that I have gone through, I would like to have root, is this well rooted device or not?