Home › Forums › Calendar Products › Events Calendar PRO › Schema On Event List Pages
- This topic has 12 replies, 6 voices, and was last updated 7 years, 2 months ago by Brandon Hughes.
-
AuthorPosts
-
December 22, 2016 at 6:28 pm #1209848Brandon HughesParticipant
Hello,
I am trying to get my events to show in Google search similar to another site that also uses TEC, https://www.hawaii.com/events/ their events show in google search like this, http://prntscr.com/dk5tnr.
Right now for my site the schema markup is showing only for individual events and not list of events.
I had someone take a look and do some tests, here is their response. “And when I check the pages with Google Structured Data Testing Tool, the event markup is correct for the individual events, showing event and hentry types https://search.google.com/structured-data/testing-tool#url=http%3A%2F%2Ffullofevents.com%2Fhawaii%2Fevent%2Fchristmas-in-polynesia%2F but not for the list page https://search.google.com/structured-data/testing-tool#url=http%3A%2F%2Ffullofevents.com%2Fhawaii%2Fevents%2F
Are you guys able to help me with this?
Thanks
December 29, 2016 at 10:35 am #1211475NicoMemberHi there Brandon,
Thanks for getting in touch with us! You are right our listing pages don’t have a specific output of structured data as the single events have’s.
Quick solution you can add an ‘Events List’ widget (which haves the option to output structured data) to the pages in which you want this data to be fetched. The not so quick solution (seems the folks from hawaii.com have done this) is to customize the event list templates (as explained in our themer’s guide) to add the necessary markup for each event to be recognized as such by Google. If you inspect the code from hawaii.com you’ll notice the hentry vevent and other classes that tag the event information.
I’ll explore a third option of outputing the ld+json structured data for list view via snippet, but not sure if it’s easily achievable. Give me a bit of time and I’ll get back to you on this.
Best,
NicoDecember 29, 2016 at 10:54 am #1211481NicoMemberHey Brandon,
After some testing I came with a snippet to add the structured data to list view. Just paste the code below in your theme’s (or child theme’s) functions.php file and give this a try:
/* Tribe, add structured data to list view */
function tribe_list_view_structured_data ( ) {// bail if not list view
if ( !tribe_is_list_view() ) return;global $wp_query;
Tribe__Events__JSON_LD__Event::instance()->markup( $wp_query->posts );
}
add_action( 'wp_head', 'tribe_list_view_structured_data');
I haven’t heavily tested this and not sure how it will behave with Google, but I guess it’s at least a good starting point to get this working.
Please let me know about it,
Best,
NicoDecember 29, 2016 at 4:54 pm #1211561MathewParticipantNico,
Thanks for the snippet. It’s one I’ve been looking for.
On a side note: The hawaii.com website is using version 3.12 of TEC. The implementation of the structured data and the use of event markup tags has changed in version 4.x.
Now playing the waiting game with Google to see if the snippet has the desired effect.
Again, Thanks Nico.
December 30, 2016 at 7:47 am #1211712NicoMemberThanks for the feedback Mathew! Seems you are better informed than me 😉 It’s always a pleasure when you chime in!
Please give us a heads-up when you have a chance to see if this works as expected. I’ve flagged this to be discussed at next team scrum… Should we add structured data (or at least the option) in all calendar pages? I see you have reached out in the past to make a point on this. If you want to add any opinions here (Brandon you are welcome to do it as well) feel free to do so!
Thanks,
NicoJanuary 8, 2017 at 4:16 pm #1214918Brandon HughesParticipantHi Nico,
So far no joy.
Should this work with multisite as well?
Thanks
January 12, 2017 at 10:38 am #1217556NicoMemberThanks for the follow-up Brandon!
Should this work with multisite as well?
I think so. It’s actually pretty easy to check for this, just paste the snippet in the theme’s (or child theme’s) functions.php file and then visit the calendar (list view). In the source code of the page (in the head tag) you should find the following structure:
<script type="application/ld+json">
[{"@context":"http://schema.org","@type":"Event","name":"Your first event in the view name",...
</script>
Please let me know if you are able to check for this,
Best,
NicoJanuary 16, 2017 at 2:33 pm #1219255aurelienParticipantHello,
For category pages, the code is good/* Tribe, add structured data to list view */ function tribe_list_view_structured_data ( ) { // bail if not list view if ( !tribe_is_list_view() ) return; global $wp_query; Tribe__Events__JSON_LD__Event::instance()->markup( $wp_query->posts ); } add_action( 'wp_head', 'tribe_list_view_structured_data');
But it does not work for places.
Do you have the solution?January 16, 2017 at 8:05 pm #1219403NicoMemberHi there @aurelien,
Thanks for chimming in! The snippet will only work in list view as it’s coded. That’s why it’s not working in places (I guess you mean venue pages).
Can you please open a new thread for this? Be sure to link back to this one, and ask for help adapting the snippet for your needs.
Thanks,
NicoJanuary 20, 2017 at 12:59 pm #1221693Brandon HughesParticipantHi Nico,
The developer I work with has tested this and still does not see any schema code being generated on the list page.
Let me know if you have any other ideas or suggestions and we will test.
Brandon
January 23, 2017 at 1:02 pm #1222559NicoMemberThanks for the heads-up Brandon and sorry to hear about this still not working 🙁
I’ve just tested this with default Theme Tweenty Seventeen, in a local multisite install and it’s working as expected. Can you please ask the dev to test this with default theme (temporarily adding the snippet to the functions.php file) and no other plugins active? This way we can see if there’s a conflict with the snippet.
Other things to check:
– Remember this version of the snippet is just intended to work in list view.
– Reset all types of cache and make sure the source code is refreshed.The snippet is actually pretty simple, and I can’t think of others reasons why this is not working for you. But please let me know about the tests above and I’ll help as possible.
Best,
NicoFebruary 14, 2017 at 8:35 am #1234593Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Schema On Event List Pages’ is closed to new replies.