Site logo

[Resolved] Problem with RSS feed

Home Forums Support [Resolved] Problem with RSS feed

Home Forums Support Problem with RSS feed

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1731555
    Mathieu

    Hello

    I wonder if somebody can help.

    I use the RSS feed with the newsletter (I use MailerLite). Before switching to GeneratePress, the /feed/rss2/ url worked fine. After switching to GeneratePress, that URL type stopped working with MailerLite for some reason.

    The /feed/rdf/ or /feed/atom/ work, but I’m strugling to get the featured image right. It looks like it is ignoring my size setting (full) and get a low res version that looks all pixelated.

    Here is the code I’ve added to the functions.php style using the Snippets plugin.

    // you can adjust what size image is pulled, and it's positioning in the $output below
    function featured_image_in_feed( $content ) {
        global $post;
        if( is_feed() ) {
            if ( has_post_thumbnail( $post->ID ) ){
                $output = get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'float:right; margin:0 0 10px 10px;' ) );
                $content = $output . $content;
            }
        }
        return $content;
    }
    add_filter( 'the_content_feed', 'featured_image_in_feed' );
    add_filter( 'the_excerpt_feed', 'featured_image_in_feed' );
    

    Any clue on how to fix it?

    Many thanks!

    Mat

    #1731562
    Leo
    Staff
    Customer Support

    Hi there,

    That function looks alright and it should work for any themes as those are WordPress filters.

    Do you see the same issue when using a Twenty series WP theme?

    Let me know 🙂

    #1731759
    Mathieu

    Hi Leo

    I tried to switch to a twenty theme, and the featured image in the newsletter loaded with the right size (no pixelation). I switched back to GP and… it’s fine now! Not sure what happened there, something must have reset.

    Thanks!

    #1731777
    Leo
    Staff
    Customer Support

    Glad to hear 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.