• This one should be pretty simple, I just want to add some extra lines to an RSS feed for a specific category
    (specifically, the website hosts podcasting, so I need extra lines in both the header and the post areas of the rss2 feed.)

    I saw in the codex this:

    remove_all_actions( 'do_feed_rss2' );
    add_action( 'do_feed_rss2', 'acme_product_feed_rss2', 10, 1 );
    
    function acme_product_feed_rss2( $for_comments ) {
        $rss_template = get_template_directory() . '/feeds/feed-acme_product-rss2.php';
        if( get_query_var( 'post_type' ) == 'acme_product' and file_exists( $rss_template ) )
            load_template( $rss_template );
        else
            do_feed_rss2( $for_comments ); // Call default function
    }

    Will this work? Where do I put it, in the theme’s functions file?

    Please don’t recommend a plugin. I’d rather edit the theme directly if possible.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m sorry no one responded to your question. You’ve probably figured this out by now, but for anyone else finding this via search, yes it’ll work with some adjustments because it is for a specific post type and template.

    It will work in the theme’s functions.php file, but we recommend creating a child theme even if this is the only significant content. One could also create a custom plugin to contain the code.

Viewing 1 replies (of 1 total)
  • The topic ‘Updating RSS Feed’ is closed to new replies.