[wp-hackers] change number of posts displayed on the page

Mark Jaquith mark.wordpress at txfx.net
Sun Jan 16 20:30:36 GMT 2005


I just have a "hacks.php" plugin file that I add random stuff to.  I put 
in this:

> if(my_condition() == TRUE) {
> $posts_per_page = 30;
> }

You can even adjust it per category if you wish.  One good use of this 
would be to list 9999999 posts for each "is_year()" archive, but then 
make a year.php template, and only display the titles of the entries.

scriptygoddess wrote:

>I'm trying to set it up so that a home page will show 8 posts - but my
>category pages will show ALL posts in that category. It doesn't appear
>as if anything built in will do what I need it to - so I guess I'll be
>writing a hack or plugin to do this.
>
>My question is though, is that I'm not really sure where to start.
>What line (in which include) is determining the number of posts for
>the page. (I did see a function with "posts_per_page" - but I couldn't
>see where that's defined.
>
>Does anyone have any ideas how to approach this?
>


More information about the hackers mailing list