Site logo

Archived topic

The Event Calendar title in Page Headers

13 replies · Started by Antal on June 20, 2018

Viewing posts 1–14 of 14

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 :)

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

What does {{post_title}} output?

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 :)

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

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

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

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

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() : '';
} );

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?

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

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.

This archived topic is closed to new replies.