Custom Post type Feature image Problem

Hi, I have custom Post Type

public function get_news() {
$args = array(
‘post_type’ => ‘news’,
‘post_status’ => ‘publish’,
);

  $news = new \WP_Query( $args );
  return $news;

}

and Have News.blade.php

@php
$news = $get_news;

get_the_post_thumbnail($news->ID, ‘large’);

@endphp
This Give me Post “feature image” and I want post type “news” feature image Please help me

Does $news->ID hold a value that corresponds to the ID of a news-post? If not, what does it hold and what does $news hold?

This topic was automatically closed after 42 days. New replies are no longer allowed.