Forums

Remove Caption Shortcode from the_content_rss ... ? (4 posts)

  1. chazbeaner
    Member
    Posted 2 months ago #

    Anyone know how to strip the caption shortcode from the_content_rss output? HTML markup for the img itself gets stripped, but the caption shortcode remains...

    I have tried strip_shortcode, remove_shortcode, remove_all_shortcode but to no avail.

  2. husklynet
    Member
    Posted 1 month ago #

    I am also in need for a solution to this problem. I have an XML-file a partner needs to use, but I can't seem to get rid of the [caption]-part of posts with images in them.

    Does this require some preg_replace or something? If so, can anyone point me in the direction of a solution?

  3. careybradfield
    Member
    Posted 1 month ago #

    this was posted somewhere else:

    add to the feed.php file

    $content = apply_filters('the_content_rss', $content); /* already was there, here is for navigation. it's near 164 line */
    $content = preg_replace("/\[caption.*\[\/caption\]/", '', $content); /* string itself */
    if ( $cut && !$encode_html ) /* next line, for navigation too */

  4. jothiek
    Member
    Posted 3 weeks ago #

    I'm having the same problem. And I'd like to try the code given above too, but only thing is I can't find a feed.php. Help anyone?

Reply

You must log in to post.

About this Topic