WordPress.org

Ready to get started?Download WordPress

Forums

Display featured image in RSS Feed (1 post)

  1. kallekillen
    Member
    Posted 1 year ago #

    Hi,

    I'm trying to customise my feed to display the featured image of a post, but ONLY if it's in a specific category (let's call it "whatever").

    Am I right to think I would use something in the lines of this in the feed:

    <?php if (in_category( 'whatever' )) : ?>
     <media:content url="<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>" medium="image" />

    Or is there a way for me to just do it through functions.php/feed.php?

    Any help would pe highly appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.