show venue and city on single event

Home Forums Calendar Products Events Calendar PRO show venue and city on single event

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1124503
    Pau
    Participant

    Dear TECPRO,

    I know, I know, I know you don’t provide bespoke customization guides, but this is a simple question

    On a single event page (http://79.170.44.126/ref-spainculturescience.co.uk/event/vamos-festival/) I would like to show:

    – Title
    – Date
    – Venue and City

    I know I have to get the single event php file from /public_html/wp-content/plugins/the-events-calendar/src/views/single-event.php

    edit it, and upload it into my theme subfolders (as explained in the php file)

    The question is:

    could you please supply the code line and where to put it in the php file?

    I really think this would be really helpful for me and other users as probably is an FAQ

    yes?

    Thanks

    #1124549
    George
    Participant

    Hey Pau,

    Our single event templates already show all of that information. Check out this single event on our demo site to see the standard display of information: http://wpshindig.com/event/coffee-code/2016-06-16/

    You’ll see that title, venue, and date and such all display on the single event template.

    1. If you have made ANY code customizations to The Events Calendar or Events Calendar Pro, try temporarily disabling these customizations (ensure you have a backup of them!). Once you do this, does the default information display?

    2. If not, then can you temporarily activate a default theme like Twenty Twelve or Twenty Sixteen? In this theme, do the single-event templates show all of the correct data like they are designed to do?

    Let us know what you find.

    And PS—I noticed that your domain name may by problematic:

    http://79.170.44.126/ref-spainculturescience.co.uk/event/vamos-festival/

    The events slug CANNOT be a subdirectory in the URL. It has to be on the root of the domain name. So, any of these would be fine:

    • http://79.170.44.126/event/vamos-festival/
    • http://ref-spainculturescience.co.uk/event/vamos-festival/
    http://example.com/event/vamos-festival/

    But these will not work and are not supported:

    http://79.170.44.126/subfolder/other-folder/folder/event/vamos-festival/
    http://ref-spainculturescience.co.uk/79.170.44.126event/vamos-festival/
    http://example.com/testing/showcase/event/vamos-festival/
    http://example.com/spainculturescience.co.uk/event/vamos-festival/

    ☝️ I just wanted to highlight this as it may be causing odd behavior for you on your site.

    — George

    #1124603
    Pau
    Participant

    yes, ok, im working on a developer site till ready to move to proper URL (didnt thought about that); thanks for the valuable advice

    BUT no, I dont see the venue and city on the link you passed: http://wpshindig.com/event/coffee-code/2016-06-16/

    it says:

    Toronto Coffee & Code (title)
    June 16 @ 3:00 pm – 6:00 pm
    |Recurring Event (See all)

    #1125119
    George
    Participant

    Hey @Pau,

    Okay, thank you for responding here—I think I better understand what you are asking!

    1. Can you confirm that if you scroll down on that wpshinding.com page, you see the venue and city information and all of that as shown in this screenshot?

    2. Can you confirm exactly where and how you are trying to get the venue and time information to display? So, say this is what the title section currently has:


    Toronto Coffee & Code
    June 16 @ 3:00 pm – 6:00 pm | Recurring Event (See all)

    Are you trying to make it like this:


    Toronto Coffee & Code
    June 16 @ 3:00 pm – 6:00 pm | Recurring Event (See all)
    Venue Name, City

    3. Finally, can you please confirm that you are aware that doing this will require a customization on your end, and that you are aware that we cannot fully assist with customizations? I will happily help you get started in the right direction here, no worries! But just want to set your expectations early—I can show you the basics, but to get things “just right” and exactly how you want, you will have to take the reins and tinker on your own. This page covers our support policy in this regard ? https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/

    Cheers!
    George

    #1125238
    Pau
    Participant

    Dear George,

    Yes, I’m aware that I ned to customise at my end, and I’m thankful if you can help me to get it going. Im aware of the blocks bottom page with fine details of venue, map, etc…

    What I exactly want is, At the TOP of the page (before scrolling down) where it says:

    Toronto Coffee & Code
    June 16 @ 3:00 pm – 6:00 pm
    |Recurring Event (See all)

    to say:

    Toronto Coffee & Code
    16 June
    Early Bird Coffee, Toronto

    I understand that this also depends on of the settings and the timing of the event, if is recurrent, etc.. And that I’ll need to fine tune it…

    But you get the basic idea

    Many thanks for your interest and help

    Yours,

    • This reply was modified 7 years, 11 months ago by Pau.
    #1125342
    George
    Participant

    Sure thing, @Pau.

    There are two methods for implementing the sorts of changes you want. The first method is to find this file in your copy of The Events Calendar:

    /the-events-calendar/src/views/single-event.php

    Copy and paste the contents of these files into a new file inside your theme at this location:

    [your-theme]/tribe-events/single-event.php

    In this theme version of the file, you can add the template tags for venue and city and all of that wherever you see fit.

    Read more about this method of creating theme versions of plugin files here ? https://theeventscalendar.com/knowledgebase/themers-guide/


    The second method is simpler. You can use filters and do something like this:

    add_filter( 'tribe_events_event_schedule_details', 'pau_add_content_after_schedule_details', 10, 4 );

    function pau_add_content_after_schedule_details( $schedule, $event_ID, $before, $after ) {

    if ( is_singular( 'tribe_events' ) ) {
    $schedule .= sprintf( '%s, %s <br>', tribe_get_venue( $event_ID ), tribe_get_city( $event_ID ) );
    }

    return $schedule;
    }

    You can use functions tribe_get_venue() and tribe_get_city() to display venue information. Check out the-events-calendar/src/functions/template-tags/venue.php to see all available template tags for venues.

    These template tags can also be used to great effect with the first method described above.

    Best of luck with your customizations!
    George

    #1125530
    Pau
    Participant

    Hi George, this is awesome, many thanks!

    I think I managed to do it, see here: http://79.170.44.126/ref-spainculturescience.co.uk/event/design-dali-tusquets-land-bd/

    Now a very stupid final question if you don’t mind: I’m trying to get the venue and city same as date, but somehow I don’t manage it; could you please have a quick look at this and tell me whats wrong? (Final question, I promise!):

    	<?php the_title( '<h2 class="tribe-events-single-event-title">', '</h2>' ); ?>
    
    	<div class="tribe-events-schedule tribe-clearfix">
    		<?php echo tribe_events_event_schedule_details( $event_id, '<h3>', '</h3>' ); ?><br />
    		<?php echo tribe_get_venue( $event_id, '<h3>', '</h3>' ); ?>, <?php echo tribe_get_city( $event_id, '<h3>', '</h3>' ); ?>
    
    		<?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>
    • This reply was modified 7 years, 11 months ago by Pau.
    • This reply was modified 7 years, 11 months ago by Pau.
    • This reply was modified 7 years, 11 months ago by Pau.
    • This reply was modified 7 years, 11 months ago by Pau.
    • This reply was modified 7 years, 11 months ago by Pau.
    #1126409
    George
    Participant

    Hey @Pau,

    Two problems I see there are that you’re adding second and third parameters to functions that only have allow for one parameter.

    So, for example:
    <?php echo tribe_get_venue( $event_id, '<h3>', '</h3>' ); ?>

    ☝️ You cannot add the <h3> or </h3> tags there. The function only allows for the first parameter, $event_id.

    An alternative that might work better:


    <h3><?php echo tribe_get_venue( $event_id ); ?></h3>
    <h3><?php echo tribe_get_city( $event_id ); ?></h3>

    You’ll have to take the reins from there—I hope this helps!

    — George

    #1126582
    Pau
    Participant

    Hi George, reins taken, problem sorted, big thanks to you for patience and kindness.

    All the best

    Pau

    #1126877
    George
    Participant

    ☝️ Thanks for the kind words, Pau. I’ll close up this thread for now; but don’t hesitate to open a new thread any time if other issues/questions/comments/concerns arise.

    Cheers,
    George

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘show venue and city on single event’ is closed to new replies.