Home › Forums › Calendar Products › Events Calendar PRO › Schema on Calendar Page
- This topic has 8 replies, 2 voices, and was last updated 8 years, 2 months ago by
Janice Palmer.
-
AuthorPosts
-
January 24, 2018 at 10:25 am #1434909
Janice Palmer
ParticipantHi there.
I was hoping to get Event List schema on my calendar page.
I found this old ticket: https://theeventscalendar.com/support/forums/topic/schema-on-event-list-pages/
And I added the snippet to functions,php but I’m not sure if it’s working.
January 25, 2018 at 11:42 am #1436275Andras
KeymasterHi Janice,
Thanks for getting in touch.
That snippet is pretty old. Since then I believe there were changes in the code of the plugin which renders it pretty much useless.
I will try to check what else can be done about this, but I will need some time for that, so hang in there.
Cheers,
AndrasJanuary 25, 2018 at 12:41 pm #1436362Janice Palmer
ParticipantThank you Andras
No rush, let me know when you figure it out.
February 13, 2018 at 12:41 am #1451370Andras
KeymasterHi Janice,
I do apologize for the unusually long pause. The whole team was out for a week, and as a result we were overloaded afterwards. We’re getting back on track now-ish.
We took a look at the snippet. A teammate tested it and for him the snippet did work.
Let me put here the full instructions, to have it at one place.
Place this code in your theme’s (preferably child theme’s) functions.php file.
/* 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');Then visit the calendar (list view). In the source code of the page (in the head tag) you should find the following structure:
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.Please check and let me know.
Cheers,
AndrasFebruary 13, 2018 at 6:17 am #1451583Janice Palmer
ParticipantAwesome!
Thank you so much.
I was curious if I could also edit this code for the other views, especially the photo view.
Would that be easy to do?
February 14, 2018 at 12:47 am #1452536Andras
KeymasterAt the beginning of the code there is this line:
if ( !tribe_is_list_view() ) return;This basically means if it is not list view, then don’t do anything. You could extend that to
if ( !tribe_is_list_view() && !tribe_is_view( 'photo' ) ) return;Andras
February 14, 2018 at 6:35 am #1452777Janice Palmer
ParticipantThank you!!
February 15, 2018 at 4:52 am #1453941Andras
KeymasterYou’re welcome Janice, I’m happy I could help!
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.
Cheers,
AndrasPS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
https://wordpress.org/support/view/plugin-reviews/event-tickets/PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!
-
AuthorPosts
- The topic ‘Schema on Calendar Page’ is closed to new replies.
