• Resolved fjvanittersum

    (@fjvanittersum)


    Hi,

    I found this code in your tutorial. It adds the featured image thumbnail to the List view widget:

    // Here we hook into our template action - just before the date tag, which is the first item in the container.

    add_action(

      'tribe_template_after_include:events/v2/widgets/widget-events-list/event/date-tag',

      'my_action_add_event_featured_image',

      15,

      3

    );

    // Here we utilize the hook variables to get our event, find the image, and echo the thumbnail.

    functionmy_action_add_event_featured_image( $file, $name, $template) {

      // Get the event for reference - we'll need it.

      $event= $template->get('event');

      $link= sprintf(

        '<a href="%1$s">%2$s</a>',

        get_the_post_thumbnail_url( $event),

        get_the_post_thumbnail( $event, 'thumbnail', array( 'class'=> 'alignleft') )

      );

      echo$link;

    }

    It is great. Unfortunately, I am not experienced in php. Can this code be modified in such a way that the full featured image is shown (not the thumbnail)? I perfer to use this code and not the custom template way.

    Thanks !

    Frans van Ittersum

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support tristan083

    (@tristan083)

    Hi @fjvanittersum ,

    Thank you for your inquiry.

    The function, get_the_post_thumbnail(), is a standard WordPress function that pulls the event’s (or post’s) featured image from the site (see: How to Get Featured Image URL in WordPress).

    Are you getting an issue with the image that’s displayed along with the widget?

    Plugin Support Darian

    (@d0153)

    Hi @fjvanittersum

    It seems like it has been some time since we received a response from you, therefore, I will consider this matter as resolved. If you require any further assistance, please do not hesitate to start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List view widget and featured image’ is closed to new replies.