Support » Plugin: Magic Fields » Getting Magic Fields to appear in RSS feeds?

Viewing 3 replies - 1 through 3 (of 3 total)
  • headworm

    (@headworm)

    Sorry for the late response to this (just registered), hopefully you’ve sorted it out by now. I’ve been having the same problem, in the end I managed to get something that works however, I can only get the fields to appear in the feed if I input something in the main wordpress post editor. It doesn’t matter what I put there, just so long as there’s something.

    I then get all my fields showing up, including images but not the actual content entered in the post editor.

    Here’s my code:

    function vehicle_info_feed(){
    global $post, $id;
    $vehicle_image = get('vehicle_image', true);
    $description = get_post_meta($post->ID, 'vehicle_description', true);
    $content = get_post_meta($post->ID, 'content', true);
    $price = get_post_meta($post->ID, 'price', true);
    		echo __('<img src="') . $vehicle_image, ('" width="200px"/>');
            echo __('<br/>Price: £') . $price, ('<br/>');
    		echo __('Description: ') . $description, ('<br/>');
    		}
    add_filter('the_content_feed', 'vehicle_info_feed');

    I know this is probably bad coding; I have no idea what I’m doing with php so just getting my feet wet really (I’m old) but hey it works. 🙂

    mikonium

    (@mikonium)

    So basically, you just take all the magic fields data and convert them to normal variables which you output normally…so instead of using the unsupported Magic Fields functions, it uses the regular functions?

    It looks pretty solid; thanks a lot – this’ll really help.

    headworm

    (@headworm)

    I gave up on all the other solutions, like yourself I just couldn’t get them to work so I just started experimenting.
    It’s not perfect by any means because if you use the main post editor the content won’t appear in the feed but yet you have to type something in there to get the magic fields to appear. If you can improve on it please do share cos my brain is fried for now. lol

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting Magic Fields to appear in RSS feeds?’ is closed to new replies.