Wordpress Query Posts


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php query_posts('category_name=wordpress&showposts=5'); ?>
  2. <?php while (have_posts()) : the_post(); ?>
  3. <li><a href="<?php the_permalink(); ?>">
  4. <?php the_title(); ?>
  5. </a></li>
  6. <?php endwhile; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.