Support

Home Forums Event Espresso Premium Show image next to event title

Show image next to event title

Posted: September 25, 2015 at 2:33 pm

Viewing 3 reply threads


Jennifer Bublitz

September 25, 2015 at 2:33 pm

Is there supposed to be an option to show an image next to the Event listing in EE4? If not, is there some code I can add it to do so?


Josh

  • Support Staff

September 25, 2015 at 5:14 pm

Hi Jennifer,

Usually if there is an option, it’s an option that your WordPress theme provides. It looks like the Canvas theme has an option for displaying a featured image on a single post. If that’s set to yes, it will also display a featured image next to the title of a single event.

For the event list, you can show the featured image next to the event listing by adding this code to your Canvas child theme’s functions.php file:

add_action( 'woo_post_inside_before', 'ee_woo_display_post_image_archive', 10 );

if ( ! function_exists( 'ee_woo_display_post_image_archive' ) ) {
function ee_woo_display_post_image_archive() {
    $display_image = false;
    $options = woo_get_dynamic_values( array( 'thumb_w' => '100', 'thumb_h' => '100', 'thumb_align' => 'alignleft', 'single_w' => '100', 'single_h' => '100', 'thumb_align_single' => 'alignright', 'thumb_single' => 'false' ) );
    $width = $options['thumb_w'];
    $height = $options['thumb_h'];
    $align = $options['thumb_align'];
    $display_image = true;

    if ( 'true' == get_option( 'woo_woo_tumblog_switch') ) { $is_tumblog = woo_tumblog_test(); } else { $is_tumblog = false; }
    if ( $is_tumblog || ( is_single() && 'false' == $options['thumb_single'] ) ) { $display_image = false; }
    if ( true == $display_image && ! woo_embed( '' ) ) { woo_image( 'width=' . esc_attr( $width ) . '&height=' . esc_attr( $height ) . '&class=thumbnail ' . esc_attr( $align ) ); }
}
}

Then you upload a featured image for the event in the event editor.


Jennifer Bublitz

September 28, 2015 at 12:53 pm

Works perfectly! Thank you!!!


Josh

  • Support Staff

September 28, 2015 at 1:23 pm

You’re welcome.

Viewing 3 reply threads

The support post ‘Show image next to event title’ 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