Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Created October 19, 2016 18:18
Show Gist options
  • Save GeoffEW/3f9b95956aba898947c67b2b197239dc to your computer and use it in GitHub Desktop.
Save GeoffEW/3f9b95956aba898947c67b2b197239dc to your computer and use it in GitHub Desktop.
Adds ticket header image to event
<? php
// Show the ticket header img
if ( ! isset( $ticket_header_img_rendered ) ) {
$img_id = Tribe__Tickets__Tickets_Handler::instance()->get_header_image_id( $ticket->get_event()->ID );
$header_img = wp_get_attachment_image_src( $img_id, 'full' );
if ( ! $header_img ) break;
echo "<img src='{$header_img[0]}' />";
$ticket_header_img_rendered = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment