I have pasted this code ( https://gist.github.com/diggeddy/5f7c3a4584a8beb51febc9c4f33d6c5c ) in Elements so that the captions for featured images are onlyshown on single posts. So far it works great, there is just a slight problem that all captions longer than one line are stacked on each other on the same line. It seems as if there are no line breaks.
I am not sure what I need to change in order to get the line breaks.