Support » Plugin: WP RSS Aggregator » Thumbnails

  • Resolved Jenny Beaumont


    Hi Jean,

    Am finally exploring the new version in detail – wow! The conversion to CPTs is really going to open up some possibilities!

    Has anyone posted on adding thumbnails? I perused the recent forum posts but didn’t see anything. I had worked this out for the older version, but can quite put my finger on it in this latest one.


Viewing 4 replies - 1 through 4 (of 4 total)
  • After mucking about with get_content to no avail, I finally peeked in on the database and noticed that the thumbnail is already present in wprss_item_description. Now, if only I can figure out how to strip it out and echo it…

    Help welcome 🙂

    GOT IT!

    The solution pulls from the previous version in that thumbs must first be added to the feed as a function :

    function insertThumbnailRSS($content) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID, 'medium' ) . '' . $content;
    return $content;
    add_filter('the_excerpt_rss', 'insertThumbnailRSS');
    add_filter('the_content_feed', 'insertThumbnailRSS');'

    From there I had the following to both of the foreach statements in wp-rss-aggregator.php before the first update_post_meta (tho not sure placement matters much) :

    preg_match_all('/<img([^>]*)>/i', $item->get_description(), $matches);
    $all_images = $matches[0];
    $thumb = $all_images[0];

    Then added a new update_post_meta at the end (for both loops) :

    update_post_meta( $inserted_ID, 'wprss_item_thumb', $thumb);

    Finally in the query section after $source_name I added :

    $thumbnail = get_post_meta( get_the_ID(), 'wprss_item_thumb', true );

    And place $thumbnail in the echo. voilà !!

    Cool thing is, now that these are CPT, we can import into sliders (I use SliderPro, it’s the bees knees)!!!

    Thanks again Jean!

    sidenote: doesn’t integrate as well into sliderpro as i would have liked…unfortunately can’t use Imported Feeds without Feed Sources, but still room for possibility 🙂

    scratch that last comment, blog post to follow 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Thumbnails’ is closed to new replies.