Hey guys, can anyone help me out with this?
I have one attachment image/post and I need to show it as a link to the actual post in the WordPress RSS feed.
I followed a tut and am currently doing this:
<?php function mf_feedimgs($content) {
global $post, $wpdb;
$attachment_id = $wpdb?>get_var("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post->ID'
AND post_status = 'inherit' AND post_type='attachment' ORDER BY post_date DESC LIMIT 1");
$content = '<a href=". the_permalink($post->ID) ."><img src=". wp_get_attachment_url($attachment_id) ." /></a>' . $content;
return $content;
}
add_filter('the_content_feed', 'mf_feedimgs');
?>
This does output the image in the feed, but instead of linking it to the actual post, it links it to the site homepage and it also echoes the post URL above it, like in the image:

I’ve asked on the tutorial site but didn’t get a solution… any ideas?
Thanks!




