WordPress.org

Ready to get started?Download WordPress

Forums

WP RSS Aggregator
[resolved] Image options? (15 posts)

  1. arian1123
    Member
    Posted 1 year ago #

    I am using the feed to post method. Is there anyway to configure the plugin so that it shows a featured photo if one is available and it shows nothing if it does not pull a photo from the feed. Right now, if an article is being pulled and it has no image to pull from the feed I always get this generic photo, which I do not want, yet I want the photos when they are being pulled from the source.

    http://wordpress.org/extend/plugins/wp-rss-aggregator/

  2. jeangalea
    Member
    Plugin Author

    Posted 1 year ago #

    This issue is related to another plugin.

  3. japol69
    Member
    Posted 1 year ago #

    on wp-content/plugins/wp-rss-aggregator/includes/feed-processing.php find
    function wprss_items_insert_post_meta( $inserted_ID, $item, $feed_ID, $feed_url) {

    after that put:

    if ($enclosure = $item->get_enclosure())
    		{
    			$thumb = $enclosure->get_thumbnail();
    			if($thumb=="") { $thumb = get_bloginfo('template_directory')."/images/noimage72x45.gif"; }
    		}
    		update_post_meta( $inserted_ID, 'wprss_item_thumb', $thumb );

    on wp-content/plugins/wp-rss-aggregator/includes/feed-display.php
    find:
    function wprss_default_display_template( $display_settings, $args, $feed_items ) {

    inside the while loop.. add the line

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

    you can display image such as:

    if ( $general_settings['title_link'] == 1 ) {
    					$output .= "$link_before" . '<a ' . $display_settings['open'] . ' ' . $display_settings['follow'] . ' href="'. $permalink . '"><img src="'. $xthumbnail.'" />' . get_the_title() . '</a>'. "$link_after" ;
                    }
  4. jeangalea
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for suggesting this japol, full image functionality is coming in an add-on this week.

  5. jennybeaumont
    Member
    Posted 1 year ago #

    hey japol69 - this seems like a great solution, but I cannot get it to work at all. My imported posts all have thumbnails, but only the "no-image" is being saved. :-/

    Jean - ETA on your awesome add-on ? :-)
    -jennyb

  6. japol69
    Member
    Posted 1 year ago #

    yeah it used to work on Version: 3.1.1 ... when i upgraded to 3.2 it didnt work.. so i reverted to the older version

  7. jennybeaumont
    Member
    Posted 1 year ago #

    ah, gotcha thanks. am working on something...will post if it works!

  8. jennybeaumont
    Member
    Posted 1 year ago #

    This is an adaptation of the hack I had done on an older version of this plugin - does the trick quite nicely.

    #1 paste the following into the themes functions.php

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

    change the thumbnail size as needed (using 'full' might bite me in the butt for the feed, but that's what I need for my current purpose :-/)

    #2 paste the following in wp-rss-aggregator/includes/feed-processing.php, just like you said after function wprss_items_insert_post_meta( $inserted_ID, $item, $feed_ID, $feed_url) {

    preg_match_all('/< *img[^>]*src *= *["\']?([^"\']*)/i', $item->get_content(), $matches);
    $all_images = $matches[1];
    $thumb=$all_images[0];
    update_post_meta( $inserted_ID, 'wprss_item_thumb', $thumb );

    I don't need the variable you suggested, because I'm calling the metakey directly. But of course you could if you preferred.

    voilĂ  !

    still anxiously awaiting the official patch - hacks are always a bother in the long run :)

    best,
    -jennyb

    PS: this works with WP 3.5.2

  9. japol69
    Member
    Posted 1 year ago #

    yeah that was my first solution unfortunately that won't work on blog sites hosted on wordress.org ... which unfortunately my client had :(

  10. jennybeaumont
    Member
    Posted 1 year ago #

    you mean wordpress.com i suppose?

  11. japol69
    Member
    Posted 1 year ago #

    lol yeah :P

  12. jeangalea
    Member
    Plugin Author

    Posted 12 months ago #

    Coming very soon :)

  13. jeangalea
    Member
    Plugin Author

    Posted 11 months ago #

    New version out now :)

  14. martin stratton
    Member
    Posted 10 months ago #

    I need some help with this... mine is pulling the default image on all postings (http://stratexedev.com/cashmans-comments/). I agree with what has been said above, but it appears that you have fixed this?! Well, it is not working here. Thanks, for your quick follow up.

  15. jeangalea
    Member
    Plugin Author

    Posted 10 months ago #

    Martin, this support forum is for the core (Free) version only, while thumbnails and excerpts functionality is available as a premium add-on. Lets continue troubleshooting via premium support (email).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.