Adding Additional Field to Template

Home Forums Calendar Products Events Calendar PRO Adding Additional Field to Template

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1141661
    David
    Participant

    Hi,

    We have an Additional Event Field that we’re calling “Event Title”. I am trying to work this into my template on the calendar view, using the function tribe_get_custom_fields, but not sure how to call it in the code.

    I tried this but it’s not working. Am I close? I am obviously not a dev 🙂

    <?php echo tribe_get_custom_fields('Event Title'); ?>

    Thanks for any help.
    Dave

    #1141731
    Brook
    Participant

    Howdy Dave,

    It’s great to see you again. I can certainly help with this.

    The function you are referencing does not return an individual custom field, rather it returns all custom fields for a given event as an array. Thus you would want to do something more like this:

    $custom_fields = tribe_get_custom_fields();
    echo $custom_fields[ 'Name of field' ];

    And there you go! If your field’s name really is event title then ‘Event Title’ should work perfectly in place of Name of Field.

    Does that all make sense?

    Cheers!

    – Brook

    #1141734
    David
    Participant

    Hi Brook,

    Yep, it’s me back again to drive you crazy.

    This worked perfectly. Thanks so much.

    Dave

    #1141904
    Brook
    Participant

    You are welcome! It was my pleasure to help. Feel free to “drive us crazy” any time.

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Adding Additional Field to Template’ is closed to new replies.