Forums

[resolved] Display all posts in this syntax (3 posts)

  1. web20donkey
    Member
    Posted 7 months ago #

    Hi all. I have this syntax:

    <?php while (have_posts()) : the_post(); ?>

    //some code here....

    <?php endwhile; ?>

    I want to overtake the settings from "Reading Options(which is set to 3 posts)" in the wordpress admin, and display all posts here.

    Any help? Thank you.

  2. alchymyth
    The Sweeper
    Posted 7 months ago #

    try:

    <?php global $query_string;
    query_posts($query_string .'&posts_per_page=-1');
    while (have_posts()) : the_post(); ?>

    http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note

  3. web20donkey
    Member
    Posted 7 months ago #

    Thank you very much. Works like a charm.

Reply

You must log in to post.

About this Topic

Tags