Support » Plugin: The Events Calendar » maybeSpoofQuery is killing get_the_ID()

  • My theme uses get_the_ID() to do some stuf like using the featured image on a header background, but this header only exists if I use the default “page template” option on events template.

    The problem is that then Tribe__Events__Templates::maybeSpoofQuery kills the global $post and everything on the page dependent on get_the_ID() is not working.

    I’ve removed the action by using this:
    remove_action( 'wp_head', array( 'Tribe__Events__Templates', 'maybeSpoofQuery' ), 100 );
    Will this have any weird effects?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gustavo Bordoni

    (@bordoni)

    Hi @webdados,
    There is a possibility that might have some side effects with some of our other templates.

    One thing you can do is remove this action only for the single view which the side-effects will be a lot smaller unless you are using Event Tickets to sell.

    my best regards,

    Any other way to get the real event post on a place where get_the_ID() is returning 0?

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