WordPress.org

Support

Support » Plugins and Hacks » The Events Calendar » [Resolved] Upcoming events in template

[Resolved] Upcoming events in template

  • How would I go about showing what is essentially the upcoming events (events list) in my wordpress blog theme file?

    In my footer I’ve got recent comments, some links and to the right of that, I would like ‘upcoming events’.

    Any proposed solutions must be PHP whether it be calling a widget that I didn’t know existed or just a query.

    I’ve been reading over the website and this support section but haven’t come up with anything. Any help is warmly appreciated!

    http://wordpress.org/extend/plugins/the-events-calendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rob La Gatta

    @roblagatta

    Hey Mann? Thanks for the note, and for using The Events Calendar. If I understand correctly what you’re going for here, you should be able to accomplish it via template tags. Those are documented in some depth here: http://tri.be/support/documentation/.

    That help, or no? Let me know either way and I’ll follow-up as needed.

    After lots of pilfering about and sifting through every page, I came up with this:

    <ul>
    <?php query_posts('&post_type=tribe_events&posts_per_page=5'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <li>
    <?php $startdate = get_post_meta($post->ID, '_EventStartDate', true); $db = $startdate; $timestamp = strtotime($db); ?>
    
    <a href="<?php the_permalink(); ?>"><?php if ($startdate == date('l, j F')) { echo '<strong>Today:</strong>'; } ?> <?php the_title(); ?></a><br />
    <?php if ($startdate == date('l, j F')) { echo ''; } else { echo ''; echo date("l, j F", $timestamp); echo '<br />'; } ?>
    <small><?php $excerpt = strip_tags(get_the_excerpt()); echo $excerpt; ?></small></li>
    
    <?php endwhile; else: ?>
    
    <li>No events scheduled.</li>
    
    <?php endif; wp_reset_query(); ?>
    	</ul>

    Not as elegant as anything on the tribe website, but as long as this lovely plugin is working, I’m a happy Mann.

    Plugin Author Rob La Gatta

    @roblagatta

    Fantastic to hear that got you sorted, Mann? . Great work figuring that out – would love to see the finished product sometime, if you’re ever inclined to share it 🙂

    Going to mark this RESOLVED since it looks like you’re sorted, but please let us know if you need anything else down the road. Thanks again for your support.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Upcoming events in template’ is closed to new replies.
Skip to toolbar