Magic Fields
Getting Magic Fields to appear in RSS feeds? (4 posts)

  1. mikonium
    Posted 5 years ago #

    the site in question:


    I wanted to make the blog very easy for my client to update...unfortunately, now that everything is outputted with custom fields, I can't get the RSS to display any of the data. It also gives Google Reader an error when it tries to add the subscription, for some reason.

    The solutions posted in these forums, and the websites linked to in the thread do not work: http://groups.google.com/group/magic-fields/browse_thread/thread/a5eebfd7a195e4a7?fwc=1

    I think those solutions stopped working with wordpress 3.0. Or I am forgetting something.

    Any help would be greatly greatly appreciated!


  2. headworm
    Posted 5 years ago #

    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. :)

  3. mikonium
    Posted 5 years ago #

    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.

  4. headworm
    Posted 5 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic