Skip to main content
added 178 characters in body
Source Link

Please check below code to get all posts

$args = array(
    'posts_per_page' => -1,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
);

query_posts($args);
while (have_posts()): the_post();
the_title();
the_excerpt();
get_the_post_thumbnail_url($post->ID);
endwhile;
wp_reset_query();

Please try above code. Note: get_the_post_thumbnail_url(); will return featured image URL. so you can directly add into img tag like

<img src="<?php echo get_the_post_thumbnail_url(); ?>">

Please check below code to get all posts

$args = array(
    'posts_per_page' => -1,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
);

query_posts($args);
while (have_posts()): the_post();
the_title();
the_excerpt();
get_the_post_thumbnail_url($post->ID);
endwhile;
wp_reset_query();

Please try above code.

Please check below code to get all posts

$args = array(
    'posts_per_page' => -1,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
);

query_posts($args);
while (have_posts()): the_post();
the_title();
the_excerpt();
get_the_post_thumbnail_url($post->ID);
endwhile;
wp_reset_query();

Please try above code. Note: get_the_post_thumbnail_url(); will return featured image URL. so you can directly add into img tag like

<img src="<?php echo get_the_post_thumbnail_url(); ?>">
Source Link

Please check below code to get all posts

$args = array(
    'posts_per_page' => -1,
    'post_type' => 'post',
    'orderby' => 'date',
    'order' => 'DESC',
);

query_posts($args);
while (have_posts()): the_post();
the_title();
the_excerpt();
get_the_post_thumbnail_url($post->ID);
endwhile;
wp_reset_query();

Please try above code.