Overriding posts_per_page in 1.5
-
I want to display a single post on a custom template (to get a powerpoint/slideshow-like presentation). There’s almost no info I can find on how to do this within the 1.5 theme system (adding a custom template), so instead I figured I would just hack up a new page and drop it in the main WP directory.
I tried adding a “$posts_per_page = 1;” above the ‘wp-blog-header’ line, but I get a SQL error. ($cat seems to work fine, however.)
I don’t want to affect the number of posts displayed on the other pages (home, category, archives, etc.). They are fine. I just want to override it in this one case (this custom template).
I realize I could simple hack the loop and stop after one iteration, but it seems stupid not to try and limit the DB query if possible.
- The topic ‘Overriding posts_per_page in 1.5’ is closed to new replies.