• chiliberto

    (@chiliberto)


    The Textile2 plugin is a great way to be able to add formatting to image captions. By default, WordPress strips all the formatting and links in image captions.

    However, Textile links in the image caption don’t get transformed. Bold and italics look fine:

    *bold*
    _italics_

    But links don’t work:
    ‘my link:https://mylink.com’

    They seem to work elsewhere in the posts.

    I tried modifying the Textile php file to use some other signifier, but then this caused the image caption to disappear completely from the post when it was displayed on the blog.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter chiliberto

    (@chiliberto)

    OK, here’s a couple of things I did to work around this:

    I installed the Image Caption plugin (https://www.ads-software.com/extend/plugins/image-caption/) This grabs captions for images from the image title. Works nicely.

    Then I changed the priority for the hooks in Textile2.php to something really high to make it get executed last:

    add_filter(‘the_content’, array(&$this, ‘do_textile’), 600000000);
    add_filter(‘the_excerpt’, array(&$this, ‘do_textile’), 600000000);
    add_filter(‘comment_text’, array(&$this, ‘do_textile’), 600000000);

    add_filter(‘the_content_rss’, array(&$this, ‘do_textile’), 600000000);
    //add_filter(‘the_excerpt_rss’, ‘do_textile’, 600000000);

    And that’s it. Now I have links, bold, italics, etc in my images. For example this is in one of my image titles and it has bold, italics, and a link using textile formatting (asterisk, underscore, and quotes around link titles):

    *John Beasley Greene,* _Tombeau de la chrétienne [Tomb of the Christian Woman],_ 1856; albumenized salt print; 10 3/8 in. x 12 1/16 in. (26.35 cm x 30.64 cm); Collection “SFMOMA”:https://sfmoma.org, Accessions Committee Fund purchase

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Textile2] Works great, except for links in image captions’ is closed to new replies.