Support » Plugin: CPT Bootstrap Carousel » Wrong Caption text

  • Resolved hommealone


    Took a while to figure out that the “caption” feature uses the Excerpt field, and not the Caption field of the featured image; wish that was specified in an FAQ 😉 Right now you need to squint at the screenshot to figure that out.

    When I enable the Caption (“Show Slide Captions” = Show) the plugin is showing the last text from the page’s .entry-content for slides with blank excerpt field. This happens if I have captions enabled but do not fill in the excerpt field for one of the slides. It would be great if this could be corrected so that a blank excerpt field results in nothing being displayed as an excerpt, rather than the wrong text.

    I should mention that the text it is picking up erroneously comes from another plugin which inserts sharing icons at the bottom of the page content. (Sassy Social Share plugin.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Phil Ewels


    Yes, I think that this interface was never ideal and has become even more problematic with the new WordPress editor interface (as I remember it, I configured the old editor to move the excerpt to the top of the page so it was a little more intuitive..)

    It could be good to rethink the whole excerpt thing now. I think this was originally to ensure that the text was unformatted? I wrote that code a loooong time ago now though so I’m not sure. Can you think of any reason why not to use use the page content now?

    Thread Starter hommealone


    Hi Phil,

    You’d need to give the Content field a try I guess. Certainly that has the possibility of more customization for the user.

    Perhaps one reason to leave it as is might be so that everyone’s already-existing captions that were created using the excerpt field will continue to work? Or maybe you can handle that with some php logic: if the excerpt is not empty, use the excerpt, or else if the content field is not empty, use the content. Either way, checking if the field is not empty first might help the problem I faced, of picking up the wrong text from somewhere else.

    (BTW, I can add html tags into the excerpt field and they are picked up, but maybe that’s just my setup.)

    Also perhaps germane here: I wanted the Title to show up at the very top of the slide (relative to the entire slide container), with the caption near the bottom. That took some fancy CSS, since the title is within the caption container (.carousel-caption), which does not fill the entire slide. Perhaps it should not be in the caption container?

    And to make the Title not show up at all is also tricky! I had to wrap the title text in span tags and specify in my stylesheet to make that display: none. Perhaps the slide’s title should have a field of it’s own, rather than using the CPT item’s Title field? Then you could simply leave the field blank if you prefer.

    Plugin Author Phil Ewels


    You can just leave the CPT post title blank I think, then the title will not be shown.

    The markup is taken from the bootstrap docs, so I would prefer not to move the elements around.

    Thanks for the pointers / suggestions! If you fancy having a stab at any of this then the code is all open on GitHub.



Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.