• Hi,

    I’m trying to create a custom template for displaying events using The Events Calendar but things don’t work out so well.

    Here’s my code:

    <?php if (is_single()) { ?>
    	<div class="styled box">
    		<div class="left graphics"></div>
    		<h3 class="content"><?php tribe_events_title(array('depth'=> false)); ?></h3>
    		<div class="right graphics"></div>
    	</div>
    	<ul class="eventinfo">
    		<li class="date"><?php echo tribe_get_start_date(null, false); ?></li>
    		<li class="location">@<?php echo tribe_get_venue(get_the_ID()); ?></li>
    		<li class="description"><?php the_content(); ?></li>
    	</ul>
    <?php } else { ?>
    	<div style="padding: 20px 0;">
    		<div class="styled box">
    			<div class="left graphics"></div>
    			<h3 class="content">Upcoming Events:</h3>
    			<div class="right graphics"></div>
    		</div>
    	</div>
    	<ul id="current-events">
    	<?php if (have_posts()): while (have_posts()) : the_post();?>
    		<li>
    			<ul class="eventinfo">
    				<li class="name"><?php the_title('<a href="' . tribe_get_event_link() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a>'); ?></li>
    				<li class="date"><?php echo tribe_get_start_date(null, false); ?></li>
    				<li class="location">@<?php echo tribe_get_venue(get_the_ID()); ?></li>
    				<li class="description"><?php the_excerpt(); ?></li>
    			</ul>
    		</li>
    	<?php endwhile; endif; ?>
    	</ul>
    <?php } ?>

    When in single display the title shows up as “Upcoming Events” instead of the actual title of the event, and the_content() returns nothing.

    In list view It shows the same event (there’s just one) twice, once with “Upcoming Events” as title and the rest is fine, and the 2nd has no title and no venue, it has the ending date and the_excerpt() returns the entire content with the default template of the plugin.

    Any ideas?
    Thanks.

  • The topic ‘[Plugin: The Events Calendar] Custom template page for list and single events’ is closed to new replies.