<div class="row"> <div class="col-md-12"> <div class="arrow-header"> <img src="<?php echo get_template_directory_uri(); ?> /dist/images/arrow-blue.svg" class="hidden-xs hidden-sm">Upcoming Events </div> <div class="row"> <?php global $post; foreach (espresso_get_events(["limit" => 3]) as $post) { setup_postdata($post); ?> <a href="<?php the_permalink(); ?> " class="col-md-4 event-container"> <?php $image = ''; if (has_post_thumbnail()) { $image = get_the_post_thumbnail_url($post->ID, 'event_desktop'); } ?>
<?php /** * The main template file * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists * * Methods for TimberHelper can be found in the /lib sub-directory * * @package WordPress * @subpackage Timber * @since Timber 0.1 */ if (!class_exists('Timber')) { echo 'Timber not activated. Make sure you activate the plugin in <a href="/wp-admin/plugins.php#timber">/wp-admin/plugins.php</a>'; return; } $args = array('numberposts' => 3, 'post_type' => 'post'); $event_args = array(); $context = Timber::get_context(); $context['posts'] = get_posts($args); // $context['events'] = do_shortcode( '[ESPRESSO_EVENTS show_expired=true]' ); $context['events'] = espresso_get_events($event_args); $context['dynamic_sidebar'] = Timber::get_widgets('sidebar-1'); $templates = array('front-page.twig'); if (is_home()) { array_unshift($templates, 'home.twig'); } Timber::render($templates, $context);
public static function gsp_get_events($number = 3) { return espresso_get_events(["limit" => $number]); }