[Support request] The Event Calendar title in Page Headers

Home Forums Support [Support request] The Event Calendar title in Page Headers

Home Forums Support The Event Calendar title in Page Headers

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #604490
    Antal

    Hi,
    I would love to have a GP Page Header for my events, that display the title of the event. (And possibly the date and time). The regular tags {{title}} don’t work on these event pages. I hope you can enlighten me? πŸ™‚
    Example: https://3.bn1.nl/event/tristique-malesuada/

    I have found this, but can not seem to get it working. https://docs.generatepress.com/article/page-header-template-tags/

    Thanks a million!

    #604547
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Looks like we can use this function: https://theeventscalendar.com/function/tribe_get_events_title/

    We just need to add it to a shortcode:

    add_shortcode( 'events_title', function() {
        return function_exists( 'tribe_get_events_title' ) ? tribe_get_events_title() : '';
    } );

    Then use [events_title] in your Page Header.

    Let me know πŸ™‚

    #604560
    Antal

    Thanks Tom, this comes back as ‘aankomende events’ (coming events), not the title of the event.

    #604564
    Tom
    Lead Developer
    Lead Developer

    What does {{post_title}} output?

    #604565
    Antal

    I added it again Tom, it works now! (dont know what was wrong before)
    Is there, by any chance, also a similar solution for the date/time?
    Thanks πŸ™‚

    #604568
    Tom
    Lead Developer
    Lead Developer

    You should be able to use the standard date/time template tags as well if {{post_title}} works.

    #604571
    Antal

    Neither {{post_title}} or any other tags work with Event pages.

    #604575
    Tom
    Lead Developer
    Lead Developer

    Ah, the shortcode I provided is the one that’s working?

    #604577
    Antal

    Yes, the code snippet, plus [events_title] work. The title is now glorious present in the header. πŸ™‚
    (now only, if possible, the date/time)

    #604870
    Tom
    Lead Developer
    Lead Developer

    Try these:

    add_shortcode( 'events_start_time', function() {
        return function_exists( 'tribe_get_start_date' ) ? tribe_get_start_date() : '';
    } );
    
    add_shortcode( 'events_end_time', function() {
        return function_exists( 'tribe_get_end_date' ) ? tribe_get_end_date() : '';
    } );
    #1588309
    Neil

    Hi,

    I have been able to display only this title, “Upcoming Events” and the current time in the page-hero header element. I want to display the event post title and my custom taxonomy or at the least eventscalendar categories and tags in the header as well but don’t see how to do that.

    I am using the page hero header element on a custom post type and posts and would like to have eventscalendar header look the same. I was able to reposition the event post title into the header and the featured image is displaying but not the metadata. Is this possible with eventscalendar?

    #1588414
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Did you try these shortcodes?: https://generatepress.com/forums/topic/the-event-calendar-title-in-page-headers/#post-604870

    They should display the start and end times (according to their docs) – not the current time.

    #1588441
    Neil

    Hi Tom,

    Yes, I tried them – put them in my functions file and called the shortcode from the Single Post Header. Still just returns the current time. And I also tried to return the post title but it is giving me the archive title I believe, “Upcoming Events”.

    #1589735
    Tom
    Lead Developer
    Lead Developer

    You may need to check with their support on why those shortcodes wouldn’t be outputting the correct data. It’s possible that there’s something additional we need to do in order to get the correct info outside of the loop.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.