[wp-hackers] get list of items in a category

DD32 wordpress at dd32.id.au
Wed Nov 5 06:46:14 GMT 2008


Untested, But something like this i believe:

$cat = get_category_by_slug('News');
$myquery = new WP_Query( array('cat' => $cat->term_id, 'number' => 5) );


On Wed, 05 Nov 2008 17:41:13 +1100, Brian Fidler <fidler.brian at gmail.com>  
wrote:

> $myquery = new WP_Query('News');
> while ($myquery->have_posts()) : $myquery->the_post();
> ?><br><b><?php the_title(); ?></b><?php
>                     the_content();
>                 endwhile;




More information about the wp-hackers mailing list