How to display last 4 posts of cat 2,3 &7 (for ex.)?
-
I know how to display last posts for one specific cat, using:
<?php // The Query query_posts( 'cat=3' ); // The Loop while (have_posts()) : the_post(); ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> <h2><?php the_time('l j F Y') ?></h2> <?php the_content('Lire la suite »'); ?> <?php endwhile; // Reset Query wp_reset_query(); ?>
But I did not find the way to display last x (4 for ex.) posts from different categories (for ex cat 2, 3 & 7). I want those posts to be displayed from the most recent one to the oldest one (of the 4).
I read this page but a bit messy for the beginner I am:
http://codex.wordpress.org/Template_Tags/query_postsAny help would be higly appreciated!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to display last 4 posts of cat 2,3 &7 (for ex.)?’ is closed to new replies.