Events Location not showing in PHP shortcode

Home Forums Calendar Products Events Calendar PRO Events Location not showing in PHP shortcode

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1059294
    graham barnes
    Participant

    I am using the following code on my website: <?php echo do_shortcode( '[tribe_events_list limit="3"]'); ?> and although it shows the 3 upcoming events, it doesn’t show their location, however in the source there is a div with a css class of ‘tribe-events-location’ but the div has no contents, each of my events has the venue and country information completed which you can see here: https://www.dropbox.com/s/d5pat66rol3ubp2/location.jpg?dl=1 but perhaps I am missing something?

    #1059577
    George
    Participant

    Hey @graham,

    Thanks for reaching out.

    What you describe is currently the default functionality of this widget (and its corresponding shortcode) โ€“ย this is a conscious design choice in the context of the widget because widgets are usually used in small areas of the website with limited space.

    Your current list might look something like this:

    To add the location information, you will have to modify code.

    Now, we cannot help with custom code, so if you would like to change the appearance of the event address and such, you will have to take the reins on that yourself.

    However, just to get the actual information to show up in that location div, what you can do is create the following file inside your theme:

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

    Then, use the content of this Gist I made for you as the content of that file โ†’ https://git.io/vz06c

    Here’s that code in effect; you can see the location info now on events that have venues:


    You will have to take the reins from here to further get this how you would like, but I hope this all helps you get started. For more information on customizing event templates (which is what the process I laid out above, with the custom single-event.php file), check out this guide on our site โ†’ https://theeventscalendar.com/knowledgebase/themers-guide/

    Best of luck with your customizations,
    George

    #1059688
    graham barnes
    Participant

    Great that helped loads, thanks.

    #1059991
    George
    Participant

    No problem!

    Be sure to keep backups of all custom code you make ๐Ÿ™‚

    Best of luck with your site,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Events Location not showing in PHP shortcode’ is closed to new replies.