Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

UOJameson on "[Plugin: Advanced Custom Fields] Including Custom field link in rss feed"

$
0
0

I am trying to insert a custom image field link inside a custom XML tag. The link is being inserted into a <description> tag and not the <heroImage> tag.
What am I doing wrong?

<?php

function fields_in_feed($content) {
    if(is_feed()) {
        $hero_image = get_field('hero_image');
        $url = $hero_image['url'];
        $output .=  '<heroImage>'. $url . '</heroImage>';
        $content =  $content.$output ;
    }
    return $content;
}
add_filter('the_content','fields_in_feed');

?>

https://wordpress.org/plugins/advanced-custom-fields/


Viewing all articles
Browse latest Browse all 3201

Trending Articles