I'm having a devil of a time overriding the defualt setting - I'm sure there's a way of doing this, but the Wiki hasn't been helpful at all, and my searches here have been fruitless as well.
I'm having a devil of a time overriding the defualt setting - I'm sure there's a way of doing this, but the Wiki hasn't been helpful at all, and my searches here have been fruitless as well.
Maybe this is difficult?
try this just b4 calling 'the loop'
<?php if (is_month()) { $posts = query_posts($query_string . '&nopaging=1'); } ?> just before 'the loop'
this will give u all posts for one particular month, when a monthly archive is viewed.
I think u may extend it for categories.
Thanks.
sadish, this does work for Categories as well! Thanks
<?php if (is_category()) { $posts = query_posts($query_string . '&nopaging=1'); } ?>
Or, in your root index.php (not the one in your theme directory), add this before including the blog header.
$posts_per_archive_page = -1;
-1 means nopaging.
Oh, wow! Thanks so much, I've been trying to figure out how to do this for months now!
thanks ryan for that releaving piece of code!
Though, that $posts_per_archive_page method didn't work for me with WP2.0, so I had to squeeze my noodle abit. I ended up with putting this in my-hacks.php file:
if ( !function_exists('fulu_sc_fix') ) :
function fulu_sc_fix($obj) {
if(is_search() || is_archive()) {
$obj->query_vars['posts_per_page'] = 12;
}
}
endif;
add_action('pre_get_posts', 'fulu_sc_fix');
What the code do is setting the posts_per_page variable to a value of my choice when the page is_search or is_archive.
The following is probably a more robust plugin.
http://mattread.com/projects/wp-plugins/custom-query-string-plugin/
Ah ha! What a handy plugin, thanks, no need for my hack then ;-)
That plugin is a Godsend!
This topic has been closed to new replies.