$category_slug, // Use ‘category_name’ if you have the category slug or ‘cat’ if you have the category ID ‘posts_per_page’ => 1, // Only get the latest post ); $query = new WP_Query($args); // Check if the query has any posts if ($query->have_posts()) { // Loop through the posts (even though we expect only one) while ($query->have_posts()) { $query->the_post(); // Check if the post has a featured image if (has_post_thumbnail()) { // Get the featured image URL $featured_image_url = get_the_post_thumbnail_url(get_the_ID(), ‘full’); // ‘full’ can be replaced with any registered image size // Output the featured image echo ‘' . esc_attr(get_the_title()) . '‘; } else { echo ‘No featured image available.’; } } } else { echo ‘No posts found in this category.’; } // Reset the post data to ensure other queries work correctly wp_reset_postdata(); ?>

Mhangsa Events

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Numquam nesciunt amet sit ab a, totam quae aliquam cupiditate modi voluptatum, similique tempora facere delectus. Voluptatibus corrupti repellat aspernatur rem fugit.

event5+
Events
Tournament5+
Tournament
viewers5+
Viewers
Engagement5+
Engagement

Services

Lotem ipsum dolor

esports

Esports Events

Tournament

Esports Events

viewers

Esports Events

Engagement

Esports Events

Upcoming Events

Past Events

Our Motivators

News

FAQs

Scroll to Top