Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1371656

    I need to Access-Control-Allow-Origin: * header to site Feed (to disable CORS blocking for browserr fetching feed directly).
    Standard code for this is not working for me:

    add_action( 'pre_get_posts', 'add_header_origin' );
    
    function add_header_origin() {
    	if (is_feed()){
    		header( 'Access-Control-Allow-Origin: *' );
    	}
    }  

    Resolved – caching issue. Action above does the job!

    • This topic was modified 2 years, 1 month ago by M1000000. Reason: Resolved
    • This topic was modified 2 years, 1 month ago by Mike.
    #1371692

    Hey M1000000,
    Glad to hear that you have this sorted out, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘CORS issue with RSS feed’ is closed to new replies.