Adding Meta To Single Event

Home Forums Calendar Products Events Calendar PRO Adding Meta To Single Event

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1028405
    Iain
    Participant

    Hi,

    I’m trying to add a couple of pieces of the meta data to the top of the single event page but can’t figure out what I’m doing wrong as anything I put in either fails or just doesn’t show up.

    Basically I need to add ‘event category’ and ‘city’ up top, before the price. I’m adding it in here, but I can’t find how to just add the city name, rather than the whole meta block.

    <div class="tribe-events-schedule updated published tribe-clearfix">
        <?php echo tribe_events_event_schedule_details( $event_id, '<h2>', '</h2>' ); ?>
        <?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>

    If you can point me in the right direction or let me know the appropriate strings that would be fantastic.

    Regards, Iain

    #1028699
    Geoff
    Member

    Hello Lain,

    Good question. You can definitely do this but overriding the single-event.php template with your own. There’s more info on template overrides in our Themer’s Guide, but it basically boils does to this:

    • Make a copy of single-event.php. It’s located in /the-events-calendar/src/views/single-event.php
    • Make a new folder in your theme directory called tribe-events
    • Drop the copied single-event.php file in that folder

    Now that the template is in your theme directory, you can modify it to suit your needs. In this case, you can echo the following functions up where the title is:

    Will that help you get started? Please let me know. 🙂

    Cheers!
    Geoff

    #1028704
    Iain
    Participant

    That worked great thanks!Have a great weekend 🙂

    #1028720
    Geoff
    Member

    My pleasure! Thanks for following up and have a great weekend as well. 🙂

    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Adding Meta To Single Event’ is closed to new replies.