How do you display the additional fields in the list view?

Home Forums Calendar Products Events Calendar PRO How do you display the additional fields in the list view?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #997213
    Lee
    Participant

    I’m trying to display additional fields in the list view of events. The information is displayed in the single event view along with the other meta information but not in the list view.

    Is there a function I can use to get at individual additional fields and other meta information?

    I’ve tried a few options so far and I’ve noticed that some of the methods are deprecated.

    Many thanks

    #997359
    Nico
    Member

    Howdy Lee,

    Welcome to our support forums and thanks for reaching out to us!

    I think the function you are looking for is tribe_get_custom_fields. It accepts an event ID as first parameter, but if none is passed it will try to get current event ID. Once you get the fields, you can iterate through the results like this:


    $fields = tribe_get_custom_fields();
    foreach ( $fields as $name => $value ):
    echo $name . ': ' . $value;
    endforeach;

    To show those in the list view, you can perform a template override of the ‘list/single-event.php’ template as described in our Themer’s guide and include a code like the above in the template. Not sure about what you are trying to achieve but I think this can be the way to go.

    Please let me know if this answers your question,
    Best,
    Nico

    #997849
    Lee
    Participant

    Thanks Nico,

    tribe_get_custom_fields(); is what I was looking for. I know the additional field key name I’m after so I just took the array and picked out the value by key like:

    $fields = tribe_get_custom_fields();
    echo $fields['Keyname'];

    Thanks again

    #998033
    Nico
    Member

    Hey Lee,

    Glad to hear that worked for you. You can totally do it that way if you know the key name 🙂

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Have a great weekend,
    Best,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How do you display the additional fields in the list view?’ is closed to new replies.