Schema on Calendar Page

Home Forums Calendar Products Events Calendar PRO Schema on Calendar Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1434909
    Janice Palmer
    Participant

    Hi 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.

    #1436275
    Andras
    Keymaster

    Hi 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,
    Andras

    #1436362
    Janice Palmer
    Participant

    Thank you Andras

    No rush, let me know when you figure it out.

    #1451370
    Andras
    Keymaster

    Hi 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,
    Andras

    #1451583
    Janice Palmer
    Participant

    Awesome!

    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?

    #1452536
    Andras
    Keymaster

    At 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

    #1452777
    Janice Palmer
    Participant

    Thank you!!

    #1453941
    Andras
    Keymaster

    You’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,
    Andras

    PS: 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!

     

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Schema on Calendar Page’ is closed to new replies.