• here’s my steup:
    I have a the default rsswidget displaying posts from my blogpage (http//:mypage.com/blog),

    I’ve excluded some category from blog page with this function:

    function exclude_category_home( $wp_query ) {
    
        $excluded = array(20,36,37,1);
        if( is_home() ) {
            $wp_query->set('category__not_in', $excluded);
        }
    }
    
    add_action( 'pre_get_posts', 'exclude_category_home' );

    but my rss-widget still displays the categories I’ve excluded,

    anybody can help?

Viewing 1 replies (of 1 total)
  • try setting this url in rss-widget-settings in wp-admin
    https://maiolab.net/blog?cat=-36&feed=rss2

    in this way it excludes cat-36

Viewing 1 replies (of 1 total)
  • The topic ‘rss widget displaying wrong categories’ is closed to new replies.