'aevent', 'posts_per_page' => -1, 'post_status' => 'publish', ]); if (!$query->have_posts()) { return '

' . esc_html(__('No events found.', 'one-aeventure')) . '

'; } $output = '
'; while ($query->have_posts()) { $query->the_post(); $title = get_the_title(); $linkRaw = get_permalink(); $link = is_string($linkRaw) ? $linkRaw : ''; $image = get_the_post_thumbnail(null, 'thumbnail', ['style' => 'max-width:150px; height:auto;']); $output .= '
'; if ($image) { $output .= '
' . $image . '
'; } $output .= '

' . esc_html($title) . '

'; $output .= '
'; } wp_reset_postdata(); $output .= '
'; return $output; } }