WP Plugin: The events calendar show organizers featured Image if the events featured image is empty
WP Plugin: The events calendar show organizers featured Image if the events featured image is empty
WP Plugin: The events calendar show organizers featured Image if the events featured image is empty
The Events Calendar date in WP Query Loop
You problem likely results from the tribe_events_get_the_excerpt() function calling wp_reset_postdata(), which resets the global $post object back to the original query (i.e., the page the footer is on). get_the_ID() returns the ID of the global $post object, so you will get the page’s ID instead of the event’s from within the loop. And setup_postdata() does … Read more
For Past events: I have used date functino according to the time zone. Another date can also be added to the wp query. date_default_timezone_set(‘America/Winnipeg’); $date2 = date(‘y-m-d h:i’); $pastEvents = tribe_get_events( [ ‘start_date’ => ‘2014-10-01 00:01’, ‘end_date’ => $date2, ‘posts_per_page’ => 10, ] ); For Future events: $pastEvents = array( ‘post_type’ => ‘tribe_events’, ‘post_status’ => … Read more
Since you know you want only the first one and you’re not using a typical loop, you’re already using an array of posts, you can just do setup_postdata($events[0]); and then get your data from the first item here then continue your loop as written if it’s working as happily as expected.
It appears that The Events Calendar has changed “Now Onwards” to “Upcoming” on their own. This problem is now irrelevant.
Check the plugin settings and make sure ‘Use Pretty URLs’ is set to on. This fixed the issue for me.
I believe you would want to use this function (from the-events-calendar/src/Tribe/Featured_Events.php:45): /** * Confirms if an event is featured. * @param int|WP_Post $event * * @return bool */ public function is_featured( $event = null ) { $event_id = Tribe__Main::post_id_helper( $event ); if ( ! $event_id ) { return false; } return (bool) get_post_meta( $event_id, self::FEATURED_EVENT_KEY, … Read more
Okay, I found the solution myself. I used the WordPress hook parse_query. This is the most precise thing I found. And in this hook I check if it is backend and my user has his meta data called “organizer_id” which I added earlier. But it is only to get the needed organizer_id for filtering the … Read more
The “Now onwards” string is translated with _x() which is different than __() because it allows context to be added to the string being translated. Because there is context, you need to use gettext_with_context instead of gettext. Here’s a simple example based on the one in the WP.org Code Reference: function example_gettext_with_context( $translated, $text ) … Read more