最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

advanced custom fields - Modification of RSS feed is not consistent

programmeradmin4浏览0评论

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');
发布评论

评论列表(0)

  1. 暂无评论