WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP code for listing all article in monthly archive? (3 posts)

  1. databell96
    Member
    Posted 2 years ago #

    I'm trying to figure out how I can add some code to my archive.php file so it displays all posts for that month instead of the standard 10. I tried in my WP-Admin Settings to increase the number of posts to a larger number but that just increased the number of posts on my homepage as well. And that I do want set to 10 max.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    You'd need to customiser the query in archive.php.
    http://codex.wordpress.org/Function_Reference/query_posts

  3. databell96
    Member
    Posted 2 years ago #

    Yea, that worked. Took a couple of attempts but I found this worked right prior to the loop:

    <?php query_posts( $query_string . '&posts_per_page=-1' ); ?>

    Now any idea how to make a previous/next link to the previous or next month's archives?

Topic Closed

This topic has been closed to new replies.

About this Topic