WordPress.org

Support

Support » Plugins and Hacks » RSS Image Feed » [Resolved] Featured image

[Resolved] Featured image

  • Hey, great plugin (after working around the get_headers() issue).

    But I was wondering whether it would be possible to check for featured image and put this in the rss feed, so if there is no images in the post itself, it would be possible to put the featured image in the rss instead.

    https://wordpress.org/plugins/rss-image-feed/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author tepelstreel

    @tepelstreel

    Hi there,

    what get_headers() issue? People seem to have the strangest things occuring with the plugin that I never undergo in my testing environments. 😉

    I’m at the moment working on the plugin once again and actually had the same thoughts about the featured image.

    Regards

    Well get_headers() throws an error on some server enviroments (those with PHP Allow URL fopen set to OFF). But seems to only be a restriction in my test enviroment and not a problem on the production enviroment. So outcommented lines 115-116 to stop the error thrown on line 271. But let’s get past that 🙂

    I was looking into the get_feed_image function, if it would be possible to add a statement in the lines of:
    ——————————————————————-

    if (!$rif_thumb) :
    
    if ( has_post_thumbnail( $post->ID ) ){
    $img_container = '' . get_the_post_thumbnail( $post->ID, 'rss-thumbnail', array( 'style' => 'margin:0; border: 10px solid #202020' ) ) . '' . $img_container;
    }
    		endif;
    
    		return $img_container;

    ——————————————————————

    The above is not correct I know, but just an example to show my line of thought. Still working on my WP skills 🙂

    And thx by the way for the quick reply.

    Kind regards

    Plugin Author tepelstreel

    @tepelstreel

    I’m not that far yet, since I try to change the entire image class in my whole framework to something more useful. It seems to use WP functions that in deed use the fopen.

    Your thumbnail idea seems ok at a first quick glance. What I’m planning to do right now, is to implement a new image size ‘rss-image’ and see that WP does all the work, if the image is not hotlinked.

    And thank you for actually explaning a problem, that I cannot produce myself. It makes things a lot easier. 🙂

    Kind regards

    Plugin Author tepelstreel

    @tepelstreel

    The plugin now searches first for the featured image, then for the first image, attached to the post and last for any html image tag, it can find in the post content.

    That should give you the behaviour, you were looking for.

    Best

    Hi again, I haven’t been able to test the new version as I get an error.

    Warning: Cannot modify header information – headers already sent in wp-includes/pluggable.php on line 896

    Plugin Author tepelstreel

    @tepelstreel

    Hi again,

    about which version are you talking? 3.5? That should be the one with all the bugs fixed and it works as well in my multisite as in my singlesite testing environment.

    Best

    Well I downloaded version 3.5 from here, and it throws the mentioned error. Here is the link to the feed: http://selgolb.cphadsdemo.dk/feed/

    Regards

    Plugin Author tepelstreel

    @tepelstreel

    What are your settings for the feed? I must have overlooked something while testing. Do you test the plugin using a multisite installation or single site?

    Do you tell WP to show the whole post in the feed or just a summary?

    And finally (especially if using the summary) do your posts have en excerpt?

    Loads of stuff that I need to know 🙂

    http://yritys-test.waldemarstoffel.com/feed (single site)
    http://esc-blogg.atelier-fuenf.de/feed (multisite)

    That’s how they work in my testing environments…

    The site is on a single site and set to show the whole post in the blog. just deactivated all my plugins, now it seems to get worse…

    Plugin Author tepelstreel

    @tepelstreel

    Issues should be fixed in the latest version. At least, I didn’t have anything in my error logs in the testing environment

    Sorry for being a pain, dude. But now there seems to be no feed at all, just blanks it out… Also when I click save to save settings in the options page for the plugin, it goes blank…

    Plugin Author tepelstreel

    @tepelstreel

    Aaargh!

    Why don’t I ever get these errors on testing? It would make things easier. Do you work in debug mode?

    I’ll try to figure out, what is happening.

    Sorry.

    Plugin Author tepelstreel

    @tepelstreel

    Should be solved. But I thought that so often, when the thing worked with me…

    Hej Waldemar,

    It still gives problems. Error message:

    Warning: Cannot modify header information - headers already sent in /wp-includes/feed-rss2.php on line 8

    But when I remove (outcomment) line 8 in the feed-rss2.php:

    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);

    It works perfect.

    I use the standard rss2 feed php files included in WP-include.

    Feed with error (this installation is set to not throw errors, but the layout says it all):
    http://selgolb.cphadsdemo.dk/feed/

    Working feed (outcommented line 8):
    http://www.fashionvictim.dk/?feed=rss2

    I will just modify my code in the rss files where the plugin is needed, but thought you might want a detailed description about a possible error on some installations.

    (maybe if/isset/else header statement can cure this problem?)

    Cheers 🙂

    Update.

    A problem with outcommenting line 8, is that now I can’t use my rss2 feed in my RSS importer on another site (feed to post). temporary fix is to outcomment the same code (line 8 again) in the feed-atom.php and use the atom feed instead of RSS2…

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Resolved] Featured image’ is closed to new replies.
Skip to toolbar