Is it possible to loop a 360 degree YouTube video offline?
You can use marzipano which will provide all the code necessary for the viewer and provide you with a Javascript API for customization. 

A quick Google search found me this Wordpress plugin which claims to do what you want as well.

Honestly, what you're asking is quite complicated. If you can't do it on your own using the tools linked above, I suggest you hire a web developer to do it for you.