Hey.
So at first I couldn’t get this working on a normal page. I noticed that you are restricting your code to check !is_singular()
and not injecting the JS if this results in true. In my case, this means that the JS is never loaded properly… if I disable this action it works just fine.
Second point: I also noticed that you restrict the post type to just post
. I think it could be interesting to add an option in the configuration to select any type of content post type. In our case, we are using a custom type, and after adjusting that in the code everything works properly.
I could propose to create a patch if you explain the singluar bit a little bit more.