Home › Forums › Calendar Products › Events Calendar PRO › extra fields for venues
- This topic has 8 replies, 2 voices, and was last updated 9 years, 7 months ago by Brian.
-
AuthorPosts
-
August 14, 2014 at 5:40 pm #669467screenrageParticipant
What is the best way to add custom fields to Venues? What is provided out of the box in the Pro version seems very limited and there is no custom fields option like in the events section. I need to add probably 5-6 extra fields, some being check boxes some holding values.
thanks
SRAugust 15, 2014 at 6:29 am #673551screenrageParticipantI need to add things like twitter and Facebook URLs and whether a venue has WiFi and is handicap accessible.
Thanks
August 15, 2014 at 2:10 pm #675245BrianKeymasterHello,
Unfortunately, there is no way within the Events Calendar to add custom fields to the Venues.
However, it is a custom post type so you could use a plugin such as Advanced Custom Fields to add in custom fields and then use custom templates in your theme to show the custom fields you add there.
If you need help in that direction let us know and we can give you information to get you going.
Thanks.
August 16, 2014 at 6:28 am #677271screenrageParticipantYes please.
I’ve seen this type of a request many times in these forums so I’m curious why no one wrote a tutorial or at least some type of a help file on how to accomplish this.
Additionally it seems that Events Calendar Pro is not consistent in this respect; the Events part of it had custom fields functionality yet the Venues one does not. Why is that?
thanks
SRAugust 18, 2014 at 8:02 am #681070BrianKeymasterSR,
Here is a brief overview of a way to add custom fields to the Venue or Organizer Post Types in the Events Calendar using Advanced Custom Fields(ACF) Plugin.
Add ACF to your site and activate the plugin.
Click on Custom Fields in the side menu and Add New
Since this is for Venues look for the Location Box.
Make sure Post Type is selected in the first dropdown and set it equal to tribe_venue.
This will now make the Custom Fields you create in this group show only on the Events Calendar Venue Edit Page.
To create your first text field, click Add Field and fill in the information and then publish.
There are some many different options to do in ACF so it make take you a couple tries to get all the fields as you want them, here is a link to all their documentation:
Resources on creating groups:
All the Documentation for ACF
http://www.advancedcustomfields.com/resources
That will create all the fields so you can enter information in the Admin.
To display on the Front End of your site you will need to move to your theme and edit the single-venue.php found in the pro plugin. Here is out guide on making template edits:
https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/
Once you have that file in your theme you can use ACF function to display fields where you would like them.
The basic function is:
$value = get_field( "text_field" );
echo "Text:". $value;
Here is more information on using get_field()
I would recommend doing one test field and getting it created and showing on the venue edit page, then add a value to it and working on getting that value to show on the single-venue.php template. Then you should have the process down and can do the customization the way you would like.
As for why there is no additional fields in the Settings tab I do not have an answer. I will though bring it up with the developers and see if that can be added as a feature in a future release.
Thanks!
August 30, 2014 at 1:51 pm #712067screenrageParticipantThanks Brian. I’ll give this a try and if I have any followup I’ll post them here.
SR
August 30, 2014 at 2:07 pm #712078screenrageParticipantHey Brian,
I’m not seeing single-venue.php in any of the Events Calendar Pro plugin folder. Has that changed by any chance in the latest version (which I’m using)?thanks
SRAugust 31, 2014 at 3:11 pm #714158screenrageParticipantOk Brian,
I got it working but it did not like using a variable, kept returning “array” instead of what was stored in the field.So I used the_field(my_field) and it worked.
Is there a reason why you recommended I use a variable and then display its value?
thanks
SRSeptember 2, 2014 at 5:16 am #716941BrianKeymasterI was just giving an example and not sure exactly how everything would be setup. So there was not a reason, but glad you were able to work it out.
Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘extra fields for venues’ is closed to new replies.