WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Truncate (cut off) posts at given HTML tag (2 posts)

  1. benjiw
    Member
    Posted 3 years ago #

    I'm using feedwordpress to auto-import feeds from Google Reader (so I can comment on news articles and link to them from my blog). However, I would like to exclude the actual content of the syndicated posts and include only my commentary, with the headline linking to the original source.

    Google reader outputs the comments between blockquote tags, e.g.:

    blockquote tag - Shared by so and so
    Test commentary - blockquote tag

    then pulls in the rest of the post from the original source -- is there a way to have the posts automatically truncate or cutoff at the tag so that all of the images and text from the original post aren't included?

    Thanks much for any help.

  2. benjiw
    Member
    Posted 3 years ago #

    FYI, figured this out:

    Just add something like this after the content function (around line 606) in syndicatedpost.class.php in the feedwordpress plug-in folder:

    preg_match(
        '|
    <blockquote>(.*?)<\/blockquote>|si',
        $content,
        $newcontent
    );
    
    $content = $newcontent[1];
    </blockquote>

Topic Closed

This topic has been closed to new replies.

About this Topic