WordPress item list for year stuck with index limit?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

WordPress item list for year stuck with index limit?

Post by JAB Creations »

I'm trying to have WordPress spit out the list for all of 2008...however the only way to do that that I know of is to remove the year=2008 (since my blog just started). However I don't want to have to deal with this in a little less then a year. I'm running WP 2.5 and here is the code and the reference page I'm using currently...
http://codex.wordpress.org/Template_Tags/query_posts

Code: Select all

<?php
if (have_posts()) :
query_posts('posts_per_page=-1'&'year=2008');
while (have_posts()) : the_post(); ?>
 <div><a href="<?php the_permalink() ?>" tabindex="3" title="<?php the_title_attribute(); ?>"><?php the_time('M j, '); the_title(); ?></a></div>
<?php endwhile;
endif; ?>
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: WordPress item list for year stuck with index limit?

Post by JAB Creations »

Part of the tutorial had extra quotes where they shouldn't belong...removed them and it works fine.

Code: Select all

query_posts('posts_per_page=-1&year=2008');
Post Reply