add_action( 'wp_footer', function() { // 1. Only run for Admins (Security Best Practice) if ( ! current_user_can( 'administrator' ) ) { return; } // 2. Only run on Single Event pages if ( ! is_singular( 'tribe_events' ) ) { return; } // 3. Get the data $event_id = get_the_ID(); $start = get_post_meta( $event_id, '_EventStartDate', true ); $end = get_post_meta( $event_id, '_EventEndDate', true ); // Get Venue logic safely $venue_id = function_exists('tribe_get_venue_id') ? tribe_get_venue_id($event_id) : false; $location = 'No Venue Found'; if ( $venue_id ) { $address = tribe_get_address( $venue_id ); $city = tribe_get_city( $venue_id ); $state = tribe_get_region( $venue_id ); $zip = tribe_get_zip( $venue_id ); $location = sprintf('%s, %s, %s %s', $address, $city, $state, $zip); } // 4. Output to Console via JavaScript ?> .e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload), .e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload) * { background-image: none !important; } @media screen and (max-height: 1024px) { .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload), .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload) * { background-image: none !important; } } @media screen and (max-height: 640px) { .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload), .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload) * { background-image: none !important; } }
Skip to content