Support » Plugin: WP RSS Aggregator » Image options?

  • Resolved arian1123

    (@arian1123)


    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/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Jean Galea

    (@jeangalea)

    This issue is related to another plugin.

    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" ;
                    }
    Plugin Author Jean Galea

    (@jeangalea)

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

    Jenny Beaumont

    (@jennybeaumont)

    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

    japol69

    (@japol69)

    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

    Jenny Beaumont

    (@jennybeaumont)

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

    Jenny Beaumont

    (@jennybeaumont)

    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

    japol69

    (@japol69)

    yeah that was my first solution unfortunately that won’t work on blog sites hosted on wordress.org … which unfortunately my client had 🙁

    Jenny Beaumont

    (@jennybeaumont)

    you mean wordpress.com i suppose?

    japol69

    (@japol69)

    lol yeah 😛

    Plugin Author Jean Galea

    (@jeangalea)

    Coming very soon 🙂

    Plugin Author Jean Galea

    (@jeangalea)

    New version out now 🙂

    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.

    Plugin Author Jean Galea

    (@jeangalea)

    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).

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Image options?’ is closed to new replies.