Wordpress Custom Query


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



Copy this code and paste it in your HTML
  1. <?php $mycustom_query = new WP_Query('cat=106&showposts=10'); ?>
  2.  
  3. <?php while ($mycustom_query->have_posts()) : $mycustom_query->the_post(); ?>
  4.  
  5. <div class="post" id="post-<?php the_ID(); ?>">
  6. // stuff
  7. </div>
  8. <!-- .post -->
  9.  
  10. <?php endwhile; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.