WordPress.org

Forums

caption shortcode shows up in excerpt (2.9.1) (2 posts)

  1. fracture
    Member
    Posted 5 years ago #

    I include images with each post. I insert them using the 'add an image' button with the visual editor in HTML mode. The images are inserted from my media library.

    Once the entry is posted, the short version (excerpt) of the post contains the caption text of the image. Since the image itself isn't displayed in the excerpt, this doesn't make sense.

    Sample excerpt (emphasis added here - that's the tag from the image):

    cc-by:Flickr:penmachineThe video blah blah blah...

    I have to create an excerpt manually. Is there any way to prevent this issue? I'd even be willing to attempt editing a function, but that's probably beyond my skill level.

  2. wmrom
    Member
    Posted 5 years ago #

    You could apply the the_excerpt filter to the post content, manually shorten the length of the content, and hook a priority 1 filter to it that will remove shortcode from the content.

Topic Closed

This topic has been closed to new replies.

About this Topic