Reputation: 19151
This works pretty good except it is limited to 10 posts since my blog is set to show 10 posts maximum.
$featured_query = new WP_Query('cat=3');
while( $featured_query->have_posts() ){
$featured_query->the_post();
$postcount++;
...
How can I override that setting and get ALL posts in that category regardless of the maximum posts setting?
Upvotes: 4
Views: 6483
Reputation: 31
This is best way to do the list of a particular category..
> $catPost = get_posts(get_cat_ID("NameOfTheCategory"));
> foreach ($catPost as $post) : setup_postdata($post); ?>
> <div>
> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
> <p><?php the_content(); ?></p>
> </div> <?php endforeach;?>
Thanks MrPhpGuru
Upvotes: 1
Reputation: 61557
Use showposts=-1
. This will override the defaults posts setting. Per this: http://codex.wordpress.org/Template_Tags/query_posts#Post_.26_Page_Parameters
Upvotes: 1