Home › Forums › Calendar Products › Events Calendar PRO › Use Additional Field to Display Event Icon
- This topic has 7 replies, 2 voices, and was last updated 11 years, 2 months ago by
Brian.
-
AuthorPosts
-
March 4, 2015 at 11:13 am #945969
David Ruszkowski
ParticipantHello, forgive me if this has been asked before, but what I have is an additional field with the selections “Open (spots still available)” or “Closed (event is full)”. I have created a couple of icons depicting the status. What I want to do is show an “open” icon if the event is open and “closed” if it is closed.
On a normal post I would think I could do this by just calling custom field values in my page template. I’m curious how I can call these additional fields in the single event template.
Thanks so much.
March 4, 2015 at 5:26 pm #946052Brian
MemberHi,
Thanks for using our plugins.
I can help point you in the right direction on this.
You can follow our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
That will show you how to edit the single event template with custom coding in your theme.
Let me know if that helps.
Thanks
March 4, 2015 at 6:14 pm #946064David Ruszkowski
ParticipantOK so I found this script for calling the regular fields in a template…
<p>Organized by: <?php echo tribe_get_organizer(); ?></p>That works fine, but when I try and substitute “organizer” with the name of my additional field it breaks the layout. Now my question, how would the plugin define the slug for my additional field? The field name is “Hunt Status”.
Also I am guessing there will be a different way to set up this code, kind of like the difference between…
<?php include 'header.php';?>AND<?php get_header(); ?>Hopefully that makes sense.
Thanks,
DaveMarch 5, 2015 at 5:54 am #946127Brian
MemberAre you using the Events Calendar Pro’s additional fields? or Another Plugin or coding to create them?
For ours you can use this coding to display the fields:
https://gist.github.com/jesseeproductions/3ba8c5679e188946988e
Replace ‘Community Field’ with the name of your field.
Does that work?
March 5, 2015 at 5:55 am #946128David Ruszkowski
ParticipantOK I have made a little progress on this, however I still can’t seem to get it to work.
I found some code for showing additional fields in modules/meta/additional-fields.php.
Here is what I have now in single-event.php…
<div class="tribe-events-single-event-description tribe-events-content entry-content description"> <?php _e( 'STATUS:', 'tribe-events-calendar-pro' ) ?><?php foreach ( $fields as $name => $value ): ?><?php echo $value ?> <?php endforeach ?> <?php the_content(); ?> </div>Basically this should show all the fields but it doesn’t seem to be working.
Any help you could offer to what I might be missing would be appreciated.
Thanks,
DaveMarch 5, 2015 at 5:57 am #946129David Ruszkowski
ParticipantSorry I just saw your reply… I will try that.
Thanks so much,
DaveMarch 5, 2015 at 6:16 am #946134David Ruszkowski
ParticipantThat seems like it will work great.
Thanks so much,
DaveMarch 5, 2015 at 2:27 pm #946310Brian
MemberGreat, 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!
-
AuthorPosts
- The topic ‘Use Additional Field to Display Event Icon’ is closed to new replies.
