dajense
Member
Posted 4 months ago #
As the title says, using the_excerpt function images with no caption display fine in my overview pages. As soon as I add a caption the corresponding image disappears. I changed the word length and tried using a custom trim_excerpt function (http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/) without success.
Does anybody know why this is? Is this possibly a bug?
Thanks for your help.
dajense
Member
Posted 4 months ago #
Ok fixed it. Captions are shortcodes which are automagically filtered by the_excerpt ... so prevent this from happening, i.E. using the_advanced_excerpt plugin with appropriate options.
No - the_excerpt() strips out all shortcodes including those for captioned images. This is by design.
dajense
Member
Posted 4 months ago #
Maybe the shortcodes should disappear, I could live with that. But for me it stripped the image as well if I included a caption. Is this by design as well?
the_excerpt() strips all html tags, inclusive img tags, regardless if they have captions or not.
http://codex.wordpress.org/Function_Reference/the_excerpt