I believe your problem is the same (or very similar) as this one:
Please have a look and try what I and others have suggested over there. You might have to manually reinstall FPOS ( in this case please do a twrpbackup before, you will lose all your data!).
Yes. You first swipe to sideload on TWRP and then run the adb sideload [zip file]
command from the computer.
Sorry, I have not been explicit enough: I meant enter adb devices
in the terminal or cmd on your computer, and see if it outputs a device connected (just when being in TWRP).