I'm trying to pull blog posts from my Wordpress blog using the rss feed built into Wordpress. (https://example.com/blog/feed) I got a CORS error on my site. I tried adding this code into my function.php file, but it didn't help - It still gave me a CORS error, any suggestions? Thanks.
add_filter( 'allowed_http_origins', 'add_allowed_origins' );
function add_allowed_origins( $origins ) {
$origins[] = 'https://example.com';
return $origins;
}