It would be preferred to do it without Javascript, although I already tried those and they do not seem to work (or maybe I’m implementing them wrong? Haven’t worked with Javascript too much in the past).
Well, my plugin has no the loop inside it, so it can not be in the loop.
Any suggestions how to add the loop to the plugin, without displaying any other things? I’m not a too big WordPress developer sadly.