Displaying custom field on single event (follow-up)

Home Forums Calendar Products Events Calendar PRO Displaying custom field on single event (follow-up)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #961823
    mnussbaum
    Participant

    So 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' ) ): ?>
    				&nbsp;
    				<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' ) ): ?>
    				&nbsp;
    				<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!

    #962001
    Brian
    Member

    Hello 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

    #962358
    mnussbaum
    Participant

    I 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.

    #962385
    Brian
    Member

    It is hard to say what is happening without seeing the full coding. Can you paste that here?

    #962409
    mnussbaum
    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; ?>’

    #962411
    mnussbaum
    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' ) ): ?>
    				&nbsp;
    				<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' ) ): ?>
    				&nbsp;
    				<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’ ) ): ?>
    				&nbsp;
    				<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.

    #962414
    mnussbaum
    Participant

    I 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! 🙂

    #962478
    Brian
    Member

    Great 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Displaying custom field on single event (follow-up)’ is closed to new replies.