• I have following code, that displays on home latest posts. How edit this code to display recent posts from specific category? Because I need to display posts from 3 categories (Hotels, Paths and Blog).

    <!-- LOOP START -->
    <?php $the_query = new WP_Query( 'showposts=3' ); ?>
        <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
        <!-- THIS DISPLAYS THE POST THUMBNAIL, The array allows the image to has a custom size but is always kept proportional -->
          <div id="hotele"><a href="<?php the_permalink() ?>"> <?php the_post_thumbnail( array(349,349) );?></a>
          <!-- THIS DISPLAYS THE POST TITLE AS A LINK TO THE MAIN POST -->
          <div><h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2></div>
          <!-- THIS DISPLAYS THE EXCERPT OF THE POST -->
          <li><?php the_excerpt(); ?></li>
          </div>
        <?php endwhile;?>
    <!-- LOOP FINNISH -->

The topic ‘Recent posts from a specific category with image’ is closed to new replies.