Posted By

ryarwood on 01/30/12


Tagged

wordpress category query wp posts exclusion


Versions (?)

WP Custom Posts Sidebar - For Cat Exclusion


 / Published in: PHP
 

  1. <?php
  2. $recent = new WP_Query();
  3. $recent->query(array('category__and' => array(1), 'showposts'=>10));
  4. while($recent -> have_posts()) : $recent -> the_post(); ?>
  5. <li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
  6. <?php endwhile; ?>

Report this snippet  

You need to login to post a comment.