Support

Home Forums Event Espresso Premium Want to display the events schema

Want to display the events schema

Posted: November 30, 2023 at 12:19 am

Viewing 3 reply threads


Mark

November 30, 2023 at 12:19 am

I want to display the events schema on all the pages of my site that contains the shortcodes of event espresso for displaying the list of events on it. if you have any add on for this suggest me or custom coding provide me. The events schema is already showing for the single event post.


Mark

December 4, 2023 at 4:30 am

I’m using Event Espresso 5 on my WordPress site and need help adding event schema to the page where all events are displayed. Currently, the schema is only showing on single event pages. I’ve tried various methods like hooks, but haven’t succeeded. Can you provide guidance on the best solution to add JSON-LD schema for each event on the main events page?


Mark

December 6, 2023 at 12:24 am

Can someone confirm if they are actively working on this? It’s been a week without a response. Is the Event Espresso team currently active?


Brent Christensen

  • Support Staff

December 6, 2023 at 1:37 pm

Hi Mark,

I’m Event Espresso’s lead developer, please accept my apologies for the delay in getting back to you. There was some confusion amongst our support staff as to who was going to respond to you.

So right off the bat, what you are asking for is not as easy to implement as it may sound due to the way that WordPress functions. The JSON-LD schema needs to be printed within the site’s header BEFORE any content is displayed. Essentially Google (and other crawlers) want to be aware of that data before parsing the rest of the page. However, WordPress is not aware of what posts will be displayed in the loop, until it actually gets to that point in the page and runs the query. So by the time we get to the list of events being displayed on that particular page, it is too late to print the JSON-LD schema. We are able to do this for any singular event pages because the event name or ID is in the URL and we can grab the required data prior to the header being printed.

IF there was a way to know what events were going to be displayed on the page prior to the header being printed, then all you would need to do is pass each EE_Event object to the EEH_Schema::add_json_linked_data_for_event() function during the 'wp_print_scripts' action. But again, we don’t know that until its too late, therefore there is no way (that I know of) to do what you want. My apologies again, for the late reply, especially since it is likely not what you wanted to hear.

Viewing 3 reply threads

The support post ‘Want to display the events schema’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso