WordPress.org

Ready to get started?Download WordPress

Forums

Media Credit
Misfiring when caption is included? (2 posts)

  1. vernal
    Member
    Posted 3 years ago #

    Media Credit seems to work great so long as the image does not have a caption. If a caption is in place, though, it seems like the media-credit shortcode doesn't fire. I get this:

    <div id="attachment_980" class="wp-caption aligncenter" style="width: 600px">[media-credit name="Jason Lemieux" align="aligncenter" width="600"]<img class="size-large wp-image-980 colorbox-580" title="2651265613_c8595434e8_b" src="http://blahblah.com/wp-content/uploads/2011/04/2651265613_c8595434e8_b-600x400.jpg" alt="" width="600" height="400" />[/media-credit]<p class="wp-caption-text">A turtle eating a strawberrry</p></div>

    Any idea on that?

    Thanks!
    Jason

  2. wiloma
    Member
    Posted 2 years ago #

    I have this problem as well. What happens is that the [media-credit] [/media-credit] falls inside the caption code, so when the caption comes up, the first thing in the caption text is the [/media-credit] bracket.

    The workaround is simple but annoying: go back to the code and move the [media-credit] and [/media-credit] brackets so that they are first and last in the nested code, like so:

    Instead of this:

    <div id="attachment_980" class="wp-caption aligncenter" style="width: 600px">[media-credit name="Jason Lemieux" align="aligncenter" width="600"]<img class="size-large wp-image-980 colorbox-580" title="2651265613_c8595434e8_b" src="http://blahblah.com/wp-content/uploads/2011/04/2651265613_c8595434e8_b-600x400.jpg" alt="" width="600" height="400" />[/media-credit]<p class="wp-caption-text">A turtle eating a strawberrry</p></div>

    ...you want this:

    [media-credit name="Jason Lemieux" align="aligncenter" width="600"]<div id="attachment_980" class="wp-caption aligncenter" style="width: 600px"><img class="size-large wp-image-980 colorbox-580" title="2651265613_c8595434e8_b" src="http://blahblah.com/wp-content/uploads/2011/04/2651265613_c8595434e8_b-600x400.jpg" alt="" width="600" height="400" /><p class="wp-caption-text">A turtle eating a strawberrry</p></div>[/media-credit]

    It would be great if Media-Credit did this by itself but I'm sure very few people notice it.

    --Omar

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic