Support » Plugin: Instant Articles for WP » Images with captions not rendered

  • net

    (@krstarica)


    Images with captions are not rendered at all, e.g.

    [caption id="attachment_5224" align="alignnone" width="527"]<img class=”wp-image-5224 size-full” src=”…” alt=”” width=”527″ height=”333″ /> Some caption[/caption]

    Images without captions are rendered fine, e.g.

    <img class=”wp-image-5224 size-full” src=”…” alt=”” width=”527″ height=”333″ />

    https://wordpress.org/plugins/fb-instant-articles/

Viewing 8 replies - 1 through 8 (of 8 total)
  • net

    (@krstarica)

    Facebook confirmed this issue during the review:

    Missing content – embeds/media

    Additional Detail from your Reviewer:
    Please make sure that all media and embeds are transferred from the web article to the Instant Article. In this particular case the Instant Article is missing an image found in the body of the web article.

    I fixed this Issue this way github

    net

    (@krstarica)

    add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); didn’t solve the issue. Still not seeing images in instant articles.

    net

    (@krstarica)

    Debug information is the following:

    No rules defined for <html> in the context of InstantArticle
    No rules defined for <div class=”wp-caption alignleft”> in the context of InstantArticle

    kalamun

    (@kalamun)

    Same for me :\

    net

    (@krstarica)

    kalamun

    (@kalamun)

    Yesss! 🙂
    Thank you Ivan!

    So the solution is to add this to the Custom transformer rules, on the plug-in option page:

    {"rules": [ { "class": "CaptionRule", "selector" : "p.wp-caption-text" }, { "class": "ImageRule", "selector" : "div.wp-caption", "properties" : { "image.url" : { "type" : "string", "selector" : "img", "attribute": "src" }, "image.caption" : { "type" : "element", "selector" : "p.wp-caption-text" } } } ]}

    This MUST be added to the core plugin! Why would every user be expected to add this when it applies to every site that uses the default media uploader?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Images with captions not rendered’ is closed to new replies.