Additional Fields in Events List

Home Forums Calendar Products Events Calendar PRO Additional Fields in Events List

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #940445
    Helen
    Participant

    Hi,

    I’ve read through the other posts on this and looked through the documentation, but I’m struggling to know what code I need to place in my new templates (copied into my theme folder) in order to choose which additional fields I can display on the events list.

    I’ve tried using this:

    <?php echo tribe_custom_field(); ?></p>

    And it just gives me an error.

    Can someone point me in the right direction? I have four additional fields and I’d like to choose two of them to display below the venue details on the list page.

    Thanks

    Helen

    #940461
    Helen
    Participant

    I’m now using this code in the list/single-event.php file:

    <?php echo tribe_get_custom_field( ‘_ecp_custom_3’ ); ?>

    It’s not creating an error, but nothing is appearing either.

    Am I along the right lines now?

    #940492
    Brian
    Member

    Hi,

    Sorry for the issues you are having you are getting closer.

    Try:

    tribe_get_custom_fields();

    https://theeventscalendar.com/function/tribe_get_custom_fields/

    Let me know if that works.

    Thanks

    #940691
    Helen
    Participant

    Thanks Brian, it’s returning ‘Array’ – I’m going to see whether I can work out how to make it return the content of the field, but if you have any tips, that would be much appreciated.

    Thanks again,

    Helen

    #940868
    Brian
    Member

    Is the field one that would have an array of values?

    Also, here is the template functions for Pro and line 130 has tribe_get_custom_fields function:

    events-calendar-pro\public\template-tags\general.php

    #941226
    Helen
    Participant

    No, there’s just a number entered into the field that I want to display.

    I’ve pasted in the section of code from the general.php file, but that causes nothing to display.

    How do I know what the label of the field is? Is it the one I’ve given it?

    Thanks

    Helen

    #941295
    Brian
    Member

    Hi Helen,

    Sorry for the confusion we changed the method and it was not clear to me either.

    tribe_get_custom_fields actually returns an array of all additional fields created in Pro.

    So this method will work to display the value of the additional field.

    
    $additional_fields = tribe_get_custom_fields();
    echo $additional_fields['Community Field'];
    

    Change ‘Community Field’ to the label of your field and it should work.

    Let me know if it does.

    Thanks

    #941616
    Helen
    Participant

    Thank you Brian!!

    All working now 🙂

    #941630
    Brian
    Member

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Additional Fields in Events List’ is closed to new replies.