アイキャッチ画像を表示させる
$the_query = new WP_Query($args);
if( $the_query->have_posts() ){
while( $the_query->have_posts() ){
$the_query->the_post();
$id = get_the_ID();
$img = get_the_post_thumbnail($id, 'thumbnail', ['alt'=>'sample']);
}
}- get_the_ID()
- get_the_post_thumbnail()
- WP_Query()
- have_posts()
- the_post()