Query only past events and only future events in the event calendar

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

Using variables as href in anchor tags (PHP) [closed]

It’s not really a WordPress related question, but it’s a simple one. The tribe_get_event_website_link() function you are using outputs a full link. You can use SimpleXML to extract the href part and then use it later. It’s as simple as this: $website = tribe_get_event_website_link(); $xml = new SimpleXMLElement( $website ); echo ‘<a href=”‘ . $xml[‘href’]. … Read more

Pagination for event query

posts_nav_link() works off the main query. Instead of invoking your own $upcoming, just use query_posts( … ) to temporarily overwrite it, and the corresponding template tags… query_posts( array( ‘post_type’ => ‘tribe_events’, ‘eventDisplay’ => ‘upcoming’, ‘posts_per_page’ => 1, ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php tribe_get_template_part( ‘list/single’, ‘event’ … Read more

WP_Query for posts that have postmeta assigned to a taxonomy

So I found the solution after tons of searching from the events calendar’s website and modified it to suit my needs. The code is as shown below: (Note I also removed the array to string conversion since it’s pretty pointless.) <?php // Support for multiple locations to be filtered. $request_cities = array_map(function($item){return utf8_decode(urldecode($item));}, explode(‘+’, $_REQUEST[‘city’])); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)