Calling Event listing onto Homepage

Home Forums Welcome! Pre-Sales Questions Calling Event listing onto Homepage

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #829849
    Andrew
    Guest

    Hi Tribe!
    I’m just getting oriented with the Events Calendar and trying to decide if it’s worth going with the ‘Pro’ upgrade. The plugin looks awesome for the next project I’m working on, but I need to find out how I can pull in a short list of the latest events onto the homepage template I’ve created for the project. It seems like the Event Rocket Plugin offers some basic insertion of a list widget, but this is rather simple. I’d like to have Event Title, date, featured image, description text and link to more details etc.. Just like I was calling a custom post type of events into my homepage.

    I know this doesn’t seem to be built in, but it’s a real make or break as we want to have the latest events called into the homepage, yet reserve the custom homepage template I’ve created (sidebar, slideshow etc..) Let me know if there is a way we can hijack the list view and insert it into the homepage template.

    If this is possible and would require PRO based support or help, I’d be happy to go for it.
    Thanks!

    #829889
    Geoff
    Member

    Hi there, Andrew! Thanks for getting in touch.

    Great question. Yes, the Event Rocket plugin is certainly an option there for inserting the calendar with a simple shortcode, but it will lack the details you mentioned. Awesome work doing your homework. ๐Ÿ™‚

    You can run a query for events posts in a couple of different ways:

    • <span style=”line-height: 13px;”>Use theย tribe_get_events() function. This grabs all events and accepts an array parameters to order and filter the posts. It is actually built off the default WordPress get_posts() function, which is your second option.</span>
    • Use the WordPress get_posts() function.ย This grabs all posts, but you can specify the “post_type” as “tribe_events” since events are a custom post type.

    I’d also recommend heading over to our Themer’s Guide to see all the options available to you for customizing calendar templates and styles using overrides. You can also check out our documentation for a complete list of all the functions and classes available to you.

    Does this help answer your question? Please let me know. ๐Ÿ™‚

    Cheers!
    Geoff

    #829973
    Andrew
    Guest

    Hi Geoff,
    Thanks a bunch for your quick response. This definitely seems like things should work out. I went the traditional route and used Wp’s get_posts and worked a bit with understanding how I should output the get_posts() call. This is what I’ve got working..

     $posts_array = get_posts('post_type=tribe_events');
      foreach ( $posts_array as $post ) : setup_postdata( $post ); ?>
    	<div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>">
      	       <?php tribe_get_template_part( 'list/single', 'event' ) ?>
    	</div><!-- .hentry .vevent -->
    <?php endforeach;

    Thanks for your help! Wicked support.

    #829982
    Andrew
    Guest

    Just in case it’s helpful to someone else, inside my foreach statement I copy/pasted the event output from views/list/loop.php from Events Calendar which called the correct template parts to make it simulate an events list just as it does on the calendar page, right on my custom homepage. ๐Ÿ™‚

    #830185
    Geoff
    Member

    Awesome work, Andrew! Thanks so much for confirming not just the answer, but providing the actual solution as well. This will be super helpful for others who might bump into a similar situation.

    I’m going to go ahead and close this thread, but please feel free to hit us up with a new thread if any other questions pop up. We’d be happy to help. ๐Ÿ™‚

    Geoff

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Calling Event listing onto Homepage’ is closed to new replies.