Support

Home Forums Event Espresso Premium No Table Display in EE4?

No Table Display in EE4?

Posted: July 2, 2014 at 10:39 pm


Chimp Media

July 2, 2014 at 10:39 pm

Hi – I’m assuming the answer to this is still “No”, but unfortunately I didn’t find that answer until after I purchased EE4. Should I downgrade to EE3 – or how would I create a custom template to display certain fields only from an event in a table?

Thanks!

WordPress 3.9.1
EE4 4.2.6 – new installation
drsofpt.com


Dean

July 3, 2014 at 3:40 am

Hi,

There is no out of the box table template available as yet for EE4.

However, you could create an archive template that would do something similar, using this basic query code https://gist.github.com/joshfeck/e3c9540cd4ccc734e755 and the template tags https://eventespresso.com/wiki/ee4-themes-templates/

For example I created basic page template in twentytwelve theme:

<table class="events">
<?php			
$atts = array(
	'title' => NULL,
	'limit' => 100,
	'css_class' => NULL,
	'show_expired' => FALSE,
	'month' => NULL,
	'category_slug' => NULL,
	'order_by' => 'start_date',
	'sort' => 'ASC'
);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );
	if (have_posts()) : while (have_posts()) : the_post();

		$terms = get_the_terms( $post->ID, 'espresso_event_categories' );
        ?>
        <tr>
        <td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
        <td><?php echo $terms[0]->name; ?></td>   
        <td><?php echo espresso_event_reg_button(); ?></td>   
        </tr> 	
<?php
	endwhile;
	else:
?>
	<li>No Upcoming Events</li>
<?php 
    endif;
// now reset the query and postdata
wp_reset_query();
wp_reset_postdata();
?>
    </table>

This creates (a completely unstyled!) table showing the event name, category and register button http://take.ms/qx6DK

If that is not suitable or you cannot create theme page templates, then you may wish to revert to EE3.

The support post ‘No Table Display in EE4?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso