• Resolved jbkuma

    (@jbkuma)


    I would like to use a thumbnail based on the feed’s URL instead of using the the rss item’s thumbnail or the default icon.

    I can save these files to a specific location (ie blog.com/images/feedzy/[url].jpg)

    I’m trying to sort out how to do this with a filter. Here’s what I tried, but it doesn’t seem to work. (do I have to wait for the cache to rebuild? can I force it to re-cache?)

    function SDM_feedzy_insert_feed_icon( $content, $feedURL ) {
    $base_url = '/images/feedzy/'	;
    $thm_class = preg_replace("/[^A-Za-z0-9 ]/", '', $feedURL) . '.jpg';
    $content = '' $base_url . $thm_class . '' . $content;
    return $content;
    }
    
    add_filter( 'the_excerpt_rss', 'SDM_feedzy_insert_feed_icon' );
    add_filter( 'the_content_feed', 'SDM_feedzy_insert_feed_icon' );

    https://ww.wp.xz.cn/plugins/feedzy-rss-feeds/

Viewing 1 replies (of 1 total)
  • Hi,
    It seems you do not use the right hooks.
    In your case, I would use feedzy_thumb_output or feedzy_global_output.
    No need to wait for cache refresh because it doesn’t apply to the feed himself.
    Regards

Viewing 1 replies (of 1 total)

The topic ‘thumbnail based on feed URL’ is closed to new replies.