I am using the following code in my child theme's functions.php file to replace the_author() value (dc:creator node) with the value of an Advanced Custom Fields text field named custom_byline. It seemed to be working like a charm, but there are some posts which inexplicably don't update ... do you see issues with the code I didn't catch?
if(is_feed()) {
$post_id = get_the_ID();
if (get_field('custom_byline') != '') {
$creator = get_post_meta($post_id, 'custom_byline', true);
}
}
return $creator;
}
add_filter('the_author','custom_byline_in_feed');
if(get_post_meta($post_id, 'custom_byline', true)!= ''){$creator = get_post_meta($post_id, 'custom_byline', true);}
. After that what do you mean "but there are some posts which inexplicably don't update" ? when updating post you don't get the custom field updated or you don't see what you expect in the feed ? Also please post the full code of your functionstr_replace("'","'",get_post_meta($post_id, 'custom_byline', true));