Problems adding a facebook button to an event

Home Forums Calendar Products Events Calendar PRO Problems adding a facebook button to an event

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1113925
    Lluís
    Participant

    Hello, We’re using events calendar pro pluggin.
    We’ve made a customized event view where there are two buttons, one for selling tickets and another for facebook.
    The selling tickets button works perfectly but the other doesn’t work.
    Could you help us or tell us what’s wrong, please?

    Single event’s Php code attached below:

    <?php
    /**
    * Single Event Template
    * A single event. This displays the event title, description, meta, and
    * optionally, the Google map for the event.
    *
    * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
    *
    * @package TribeEventsCalendar
    *
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    die( ‘-1’ );
    }

    $events_label_singular = tribe_get_event_label_singular();
    $events_label_plural = tribe_get_event_label_plural();

    $event_id = get_the_ID();

    $additional_fields = tribe_get_custom_fields();

    ?>

    <div id=”tribe-events-content” class=”tribe-events-single”>

    <!– Notices –>
    <?php tribe_the_notices() ?>

    <?php echo tribe_event_featured_image( $event_id, ‘full’, false ); ?>
    <div class=”tribe_events_the_data”>
    <!– Title –>
    <?php the_title( ‘

    ‘, ‘

    ‘ ); ?>
    <!– Date –>
    <p class=”event_date”>
    <?php echo tribe_get_start_date( $post->ID, true, ‘l’ ) . ‘ ‘; ?> ,
    <?php echo tribe_get_start_date( $post->ID, true, ‘d’ ) . ‘ ‘; ?> de
    <?php echo tribe_get_start_date( $post->ID, true, ‘F Y’ ) . ‘ ‘; ?> //
    <?php echo tribe_get_start_date( $post->ID, true, ‘H:i’ ) . ‘ ‘; ?>
    </p>
    <!– The Cost –>
    <div class=”tribe-event-cost”>
    <p>
    <?php if($additional_fields[‘Entrada Anticipada’]) : ?>
    Anticipada:
    <?php echo $additional_fields[‘Entrada Anticipada’]; ?>
    <?php endif; ?>

    <?php if($additional_fields[‘Entrada Taquilla’]) : ?>
    Taquilla:
    <?php echo $additional_fields[‘Entrada Taquilla’]; ?>
    <?php endif; ?>
    </p>
    </div>
    <!– Event Buy –>
    <?php $url = tribe_get_event_website_url(); ?>

    <?php if ( $url ) : ?>
    <div class=”tribe-events-event-button”>
    ” class=”my-button-class single-event-button”>Comprar
    </div>
    <?php endif; ?>

    <!– Content –>
    <?php the_content(); ?>

    <!– Event Buy –>
    <?php $url_facebook = $additional_fields[‘Evento Facebook’]; ?>
    <?php if ( $url_facebook ) : ?>
    <div class=”tribe-events-event-button button-facebook”>
    ” class=”my-button-class single-event-button facebook”>Evento Facebook
    </div>
    <?php endif; ?>
    </div>

    <div class=”tribe-events-schedule tribe-clearfix”>
    <?php if ( tribe_get_cost() ) : ?>
    <span class=”tribe-events-divider”>|</span>
    <span class=”tribe-events-cost”><?php echo tribe_get_cost( null, true ) ?></span>
    <?php endif; ?>
    </div>

    <!– Event header –>

    <!– #tribe-events-header –>

    <!– Event footer –>

    <!– #tribe-events-footer –>

    </div><!– #tribe-events-content –>

    Thanks for your time.

    #1114006
    Josh
    Participant

    Hey Luis,

    Thanks for reaching out to us!

    Would you be able to provide a link to your site, you can add as a private reply if you like, so I can get a closer look at the exact issue you’re experiencing with the button?

    Thanks!

    #1114249
    Lluís
    Participant

    This reply is private.

    #1115013
    Josh
    Participant

    Hey Lluis,

    Thanks for providing those links!

    Also, would you mind copying the code into a Gist via?

    http://gist.github.com

    It looks like the pasted code above is getting formatted oddly and stripping out while trying to link portions of your button code. Having it as a gist will allow me to see the full code.

    Thanks!

    #1115352
    Lluís
    Participant

    This reply is private.

    #1115353
    Lluís
    Participant

    Hope it will be enough.
    If there’s any problem just tell me.
    Thanks.

    #1115881
    Josh
    Participant

    Hey Lluis,

    Thanks for adding that! Which field type is being used in the additional fields section there when you created the Facebook URL field? Also, can you try doing a “var_dump($url_facebook);” to see what that is giving you there?

    Thanks!

    #1116428
    Lluís
    Participant

    This reply is private.

    #1116944
    Josh
    Participant

    Hey Lluis,

    I see what’s happening here. When using the URL field type, the additional fields output there will output a linked version of the value to itself so you would get something like “http://facebook.com“. This gets thrown off a little bit when trying to set the value of the field as the link within an tag.

    The simplest way to use the value the way that you would like would be to change the field type to a traditional text field within your additional fields settings.

    Let me know if this helps.

    Thanks!

    #1117064
    Lluís
    Participant

    Yes!
    It finally works!
    Thanks for the support!

    #1118069
    Josh
    Participant

    Hey,

    No problem!

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Problems adding a facebook button to an event’ is closed to new replies.