2

I have a custom field called argument. I'm trying to add it in RSS feed using the following code, but it's not working. Am I missing something?

function acf_feed($content) {  
    if(is_feed()) {  
        $post_id = get_the_ID();  
        $output = '<acfArgument>' . get_post_meta($post_id, "argument", true) . '</acfArgument>';  
        $content = $content.$output;  
    }  
    return $content;  
}  
add_filter('the_content','acf_feed');

I added this function to function.php

Some help would be appreciated.

1
  • Have you tried the_content_feed? – fuxia Apr 12 '17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.