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!
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