I haven’t changed the code from what it was in the original template. I was just wondering whether it was technically possible or whether there was a widget or plugin. I’ll read the information you suggested.

That’s exactly the problem.
When the template (archive.php or category.php, whichever you have) is showing XY number of posts… your sidebar just replicates that.
When the single.php is showing only ONE post… your sidebar again replicates it, since it is using exactly the same Loop.