Support

Home Forums Event Espresso Premium Add Featured Image as it's own column in Table View

Add Featured Image as it's own column in Table View

Posted: August 4, 2017 at 6:51 pm


abamedicine

August 4, 2017 at 6:51 pm

Hi EE. I found this tutorial to add an Event Featured Image to Table View:
https://gist.github.com/lorenzocaum/6202e12ab276c08fc9dd

I got that working, but his puts the Featured Image directly below the Event Name, which affects the layout by increasing the row height, and it just doesn’t look very good.

What I need to do however is have the Featured Image show in its own column before the Event Name. Is this possible? I appreciate any help. Thank you!


Tony

  • Support Staff

August 7, 2017 at 10:10 am

Yes that’s possible, you’ll need to add the column to to the template, just above this line:

<th class="th-group"><?php _e('Event','event_espresso'); ?></th>

Add

<th class="th-group"><?php _e('Event Image','event_espresso'); ?></th>

That’s adds a header to the table for ‘Event Image’.

Then to use that column above this line:

<td class="event_title event-<?php echo $post->ID; ?>"><?php echo $post->post_title; ?></td>

Add:

<td class="event_image event-img-<?php echo $post->ID; ?>"><?php echo $post->post_title; ?>
	<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
	<?php the_post_thumbnail('thumbnail'); ?>
	</a>
</td>

Remove the code from the above tutorial and you should not have the feature image within its own column.

The support post ‘Add Featured Image as it's own column in Table View’ 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