is_post_type_archive not working in feed


I’m trying to alter a feed for my plugin’s custom post type to add lines for podcasting. Here is the code I’ve got right now:

add_action ('init', 'my_plugin_init');

function my_plugin_init() {
    if ( is_post_type_archive('my_plugin_custom_type') ) {
        add_action('rss2_ns', 'my_plugin_podcast_ns');

function my_plugin_podcast_ns() {
    echo 'xmlns:itunes=""';

The archive for this post type is located at, and I’m getting the feed at However, my extra line is not showing up. What am I doing wrong?

, , Ben Miller - Remember Monica 3 years 2020-08-24T05:10:19-05:00 0 Answers 45 views 0

Leave an answer