Call event title outside of single-event.php page

Home Forums Calendar Products Events Calendar PRO Call event title outside of single-event.php page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1231854
    Kari Acker
    Participant

    Hi,

    I’m trying to call the title of the event outside of the single-event.php page. I’m using the same title code the single-event.php uses.

    <h1 class='tribe-events-single-event-title'><?php the_title(); ?></h1>

    If you inspect element and take a look at the code you can see an empty h1 tag that should have the title in it.

    http://www.caidc.org.php56-22.dfw3-1.websitetestlink.com/event/2017-conference-expo/

    Im adding this code on a custom template that i’m using for the events template in the settings. I can get the page navigation and the event date to show up but the title will not. Any ideas? I don’t currently have the nav and date showing.

    #1232559
    Cliff
    Member

    Hi, Kari.

    I’m unsure if you’re overriding our template files or doing something else.

    I see our /wp-content/plugins/the-events-calendar/src/views/single-event.php file does use the_title() so I’d expect it to work in your template override as well.

    If, however, you’re trying to output it elsewhere, you might want to see if the post/event ID is available and then use something like this (untested code):

    https://gist.github.com/cliffordp/b6617db59f26c20544fcde3954c87028

    Please let me know how things go for you.

    #1249095
    Support Droid
    Keymaster

    Hey 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

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Call event title outside of single-event.php page’ is closed to new replies.