Skip Navigation

[Résolu] Displaying Modern Tribe event fields in a content template

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

With The Events Calendar Pro plugin, in the content template of single event post, display the related "Venue" post information.

Solution:

The "Events Calendar Pro" plugin is using a hidden custom field "_EventVenueID" to store the Venue post ID, you can use it to display the "Venue" post information, see the solution in details:

https://toolset.com/forums/topic/displaying-modern-tribe-event-fields-in-a-content-template/#post-1108071

Relevant Documentation:

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 6 réponses, has 2 voix.

Last updated by Luo Yang Il y a 3 années et 1 mois.

Assigned support staff: Luo Yang.

Auteur
Publications
#1106889
Screen Shot 2018-09-12 at 3.49.31 PM.jpg
Screen Shot 2018-09-12 at 3.48.33 PM.jpg

I am trying to: displaying Modern Tribe event fields in a content template (venue name, venue city, venue state)

Link to a page where the issue can be seen: hidden link

I expected to see: the venue city, state and name next to the dates in the hero area

Instead, I got: those fields are not rendering

I have added the following Modern Tribe events via the hidden custom fields area in the Toolset front-end settings.
_VenueCity
_VenueState
_VenueOrigin

For whatever reason, when I insert Toolset's shortcodes for these fields they aren't rendering anything. Can you help me out? I'm not sure what I'm missing.

#1107419

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Thanks for the details, I can login your website,

Those custom hidden fields are setup in the "Venue" post, see it here:
hidden link
With below shortcodes:

_VenueCity:[wpv-post-field name="_VenueCity"]
<hr />
_VenueState:[wpv-post-field name="_VenueState"]
<hr />
_VenueOrigin:[wpv-post-field name="_VenueOrigin"]

You can display the fields value in front-end, see the result here:
hidden link

But you are going to display those custom fields in single "event" post, I suggest you check it with "Modern Tribe events" support
hidden link

check if there is anyway to retrieve the related "Venue" posts in single "event" post, then you can use above shortcodes to display the custom fields value.

Since it is a feature of "The Events Calendar PRO" plugin, I don't have a copy of it, if you need more assistance for it, you will need to provide a copy of your website, I need to test and debug it in my localhost
https://toolset.com/faq/provide-supporters-copy-site/

#1107464

Thank you Luo, if you still have time to test and debug I actually do have a copy of "The Events Calendar Pro" plugin in that installation, and it is the latest version available.

Thank you for your help.

#1107468

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

OK, I have enabled the private message box, please provide a download URL for the "The Events Calendar Pro" plugin, thanks

#1107586
#1108071

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, The "Events Calendar Pro" plugin is using a hidden custom field "_EventVenueID" to store the Venue post ID, I have done below modifications in your website:
1) Create a content template for displaying the Venue post information, with below codes:

_VenueCity:[wpv-post-field name="_VenueCity"]<hr />
_VenueState:[wpv-post-field name="_VenueState"]<hr />
_VenueOrigin:[wpv-post-field name="_VenueOrigin"]

hidden link

2) Edit the content template for displaying single "Event" post, add below codes:

<p>
  Venue ID: [wpv-post-field name="_EventVenueID"] <br />
  Venue information: <br />[wpv-post-body view_template="venue-post-information" id='[wpv-post-field name="_EventVenueID"]']
</p>

It is only a demo, for your reference.

#1108551

Thank you Luo, it took me a minute to understand but you just helped me make complete sense of what's going on. I'm really grateful for your time and have been able to get all of this working as desired.

Have a great one.

#1109161

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

You are welcome