Home › Forums › Calendar Products › Events Calendar PRO › Displaying custom field on single event (follow-up)
- This topic has 7 replies, 2 voices, and was last updated 10 years, 12 months ago by
Brian.
-
AuthorPosts
-
May 11, 2015 at 9:05 am #961823
mnussbaum
ParticipantSo I was able to get the Tickets and Contest custom fields to pull in to the single events and display a button linking to the URLs in the custom field if they exist.
I want to add one more though, for an RSVP button, but for some reason I am having an issue pulling in a third field.
Here’s the code I used to get the Tickets and Contest buttons to work:
$ticketurl = esc_url( tribe_get_custom_field( 'Tickets' ) ); $contesturl = esc_url( tribe_get_custom_field( 'Contest' ) );<?php if ( tribe_get_custom_field( 'Tickets' ) ): ?> <strong><a class="fasc-button fasc-size-xsmall fasc-type-flat" style="background-color: #cccccc; color: #000000;" href="<?php echo $ticketurl ?>" target="_blank" data-fasc-style="background-color:#cccccc;color:#000000;">Get Tickets</a></strong> <?php endif; ?> <?php if ( tribe_get_custom_field( 'Contest' ) ): ?> <strong><a class="fasc-button fasc-size-xsmall fasc-type-flat" style="background-color: #cccccc; color: #000000;" href="<?php echo $contesturl ?>" target="_blank" data-fasc-style="background-color:#cccccc;color:#000000;">Enter to Win</a></strong> <?php endif; ?>If I create an additional field named RSVP and attempt to c/p this exact code inserting RSVP where necessary I get no result. Is there a reason I’m not able to do this for a third field? Is there a better method for doing this?
Thank you!
May 11, 2015 at 5:03 pm #962001Brian
MemberHello Again,
Glad you are getting closer on this.
I do not see why adding a 3rd or even a 4th or more would not work.
What is the coding you working with? Does something like this work:
$contesturl = esc_url( tribe_get_custom_field( 'RSVP' ) );
<?php if ( tribe_get_custom_field( 'RSVP' ) ) { ?>
Output here
<?php } ?>Let me know and we can try to help out here.
Thanks
May 13, 2015 at 9:56 am #962358mnussbaum
ParticipantI literally just copied and pasted the same code I used for the Tickets and Contest replacing them with RSVP which matched the name of the additional field and nothing gets pulled in.
May 13, 2015 at 11:44 am #962385Brian
MemberIt is hard to say what is happening without seeing the full coding. Can you paste that here?
May 13, 2015 at 11:57 am #962409mnussbaum
Participant$ticketurl = esc_url( tribe_get_custom_field( 'Tickets' ) ); $contesturl = esc_url( tribe_get_custom_field( 'Contest' ) ); $rsvpurl = esc_url( tribe_get_custom_field( ‘RSVP’ ) );` <?php if ( tribe_get_custom_field( ‘Tickets’ ) ): ?>
” target=”_blank” data-fasc-style=”background-color:#cccccc;color:#000000;”>Get Tickets
<?php endif; ?><?php if ( tribe_get_custom_field( ‘Contest’ ) ): ?>
” target=”_blank” data-fasc-style=”background-color:#cccccc;color:#000000;”>Enter to Win
<?php endif; ?><?php if ( tribe_get_custom_field( ‘RSVP’ ) ): ?>
” target=”_blank” data-fasc-style=”background-color:#cccccc;color:#000000;”>RSVP
<?php endif; ?>’May 13, 2015 at 11:59 am #962411mnussbaum
Participant$ticketurl = esc_url( tribe_get_custom_field( 'Tickets' ) ); $contesturl = esc_url( tribe_get_custom_field( 'Contest' ) ); $rsvpurl = esc_url( tribe_get_custom_field( ‘RSVP’ ) );<?php if ( tribe_get_custom_field( 'Tickets' ) ): ?> <strong><a class="fasc-button fasc-size-xsmall fasc-type-flat" style="background-color: #cccccc; color: #000000;" href="<?php echo $ticketurl ?>" target="_blank" data-fasc-style="background-color:#cccccc;color:#000000;">Get Tickets</a></strong> <?php endif; ?> <?php if ( tribe_get_custom_field( 'Contest' ) ): ?> <strong><a class="fasc-button fasc-size-xsmall fasc-type-flat" style="background-color: #cccccc; color: #000000;" href="<?php echo $contesturl ?>" target="_blank" data-fasc-style="background-color:#cccccc;color:#000000;">Enter to Win</a></strong> <?php endif; ?> <?php if ( tribe_get_custom_field( ‘RSVP’ ) ): ?> <strong><a class="fasc-button fasc-size-xsmall fasc-type-flat" style="background-color: #cccccc; color: #000000;" href="<?php echo $rsvpurl ?>" target="_blank" data-fasc-style="background-color:#cccccc;color:#000000;">RSVP</a></strong> <?php endif; ?>And if you visit http://orsvp.com/event/tokio-hotel-feel-it-all-world-tour-2015-part-2-the-club-experience/ you’ll see that the Ticket button works and if you scroll to the bottom you’ll see the Other field for RSVP displays and shows the content of it.
May 13, 2015 at 12:02 pm #962414mnussbaum
ParticipantI was actually able to resolve the issue after c/ping it here and seeing it in a different font. The RSVP one had ‘ instead of ‘ which obviously made it not work. Not sure why that happened when c/ping the text. Thanks for the help while working on it! 🙂
May 13, 2015 at 4:33 pm #962478Brian
MemberGreat glad you got it. That was just what I was going to suggest to look into.
Closing out this ticket. If you need anything else related to this topic or another please post a new topic on the forum and we can help you out.
Thanks
-
AuthorPosts
- The topic ‘Displaying custom field on single event (follow-up)’ is closed to new replies.
