show custom field in rss

Home Forums Calendar Products Events Calendar PRO show custom field in rss

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #946271
    alonso
    Participant

    I have 3 fields costume and I want to show 1 field in the rss feed.

    here is the code

    /* Working on adding Tribe Events info to RSS content */
    function tribemeta_in_feed($content) {  
        if(is_feed()) {  
            $post_id = get_the_ID();  
            $output .= '<strong>&raquo;&nbsp;Costum Field: ' . tribe_get_custom_field ()   . '</strong><br>';     
            $content = $output.$content;  
        }  
        return $content;  
    }  

    i get the code from here https://theeventscalendar.com/function/tribe_get_custom_fields/

    I choose now field 1 as the code must be properly

    any idea

    #946380
    Barry
    Member

    Hi there!

    It’s always awesome to see things like this being put together, but I do need to point out that we’re a bit limited as to how much help we can provide with customizations like this.

    What I’d recommend here though is looking at the tribe_get_custom_field() docs if that is the function you are using as it accepts (and requires) different arguments than does tribe_get_custom_fields() (note the ‘s’ at the end of the second function).

    Most notably, the label of the custom field you want to retrieve must be supplied if you use the singular form of the function.

    Does that help at all?

    #946405
    alonso
    Participant

    hi
    No one I have tested and does not help them have a better idea how to do it.

    #946477
    Barry
    Member

    So I’m still not too clear on the actual problem here, but perhaps this example code would help?

    // Using tribe_get_custom_fields() is preferable over
    // tribe_get_custom_field(), which has been deprecated
    $fields = tribe_get_custom_fields();
    
    // We can now access each individual field using its
    // label, so if I have an "Outdoors" radio button field
    // I can do:
    echo 'Taking place outdoors? ' . $fields['Outdoors'];
    #950432
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘show custom field in rss’ is closed to new replies.