WordPress print latest posts

I have a static page with 10 containers located at different places in the index.php file, i want to show the 10 latest posts. I want to echo the data for a post (title,text,thumbnail,author,time) like this:

       <div class="text">
            echo '$textfrompost3';

 <div class="title">
        echo '$titlefrompost3';


My PHP file:

   // the query
   $the_query = new WP_Query( array(
     'category_name' => 'Allgemein',
      'posts_per_page' => 10,
       "orderby"        => "date",
         "order"          => "DESC"


<?php if ( $the_query->have_posts() ) : ?>
  <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

  // insert values into variables

  <?php endwhile; ?>
  <?php wp_reset_postdata(); ?>

<?php endif; ?>

Thanks in advance, i appreciate any help you can provide.

Read more here: WordPress print latest posts

Leave a Reply

Your email address will not be published. Required fields are marked *