WordPress.org

Forums

[resolved] Multiple custom Rss Feed (2 posts)

  1. Gannet
    Member
    Posted 9 months ago #

    Hi everyone!

    I added two custom Rss Feed to a WP site. In wp-content/theme/themename/functions.php I added this lines:

    add_filter('init','init_feed_1');
    function init_feed_1() {
        add_feed('feed1','feed_1');
    }
    function feed_1{
    ...
    }
    add_filter('init','init_feed_2');
    function init_feed_2() {
        add_feed('feed2','feed_2');
    }
    function feed_2{
    ...
    }

    the first feed has no problem while the second one shows me "unknown page" error. Someone can help me?
    Thanks in advance.

  2. Gannet
    Member
    Posted 9 months ago #

    Solved!

    I added this lines

    global $wp_rewrite;
    $wp_rewrite->flush_rules( true );

    after the add_feed function and now both feed work!

Reply

You must log in to post.

About this Topic