WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] What argument do I give query_posts() to return same posts as index page? (4 posts)

  1. rickd
    Member
    Posted 5 years ago #

    Hi,

    I'm trying to make a duplicate of my index page, and have created a page with query_posts().

    What argument do I give query_posts() to return the same posts as the index page? And to make the prev/next links work if there is more than 10 posts?

    I get the following warning when using just "query_posts()" before my loop; "Warning: Missing argument 1 for query_posts() in...."

  2. rickd
    Member
    Posted 5 years ago #

    Any help with this error?

    Warning: Missing argument 1 for query_posts() in /home/html/wp-includes/query.php on line 19

  3. Steven Jones
    Member
    Posted 5 years ago #

    I think there actually has to be a query in the (), if you're not making a query then you're bringing back all the posts like the front page anyway.

    So just try something like

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

    and that should bring everything back.

    Cheers,
    Steve

  4. rickd
    Member
    Posted 5 years ago #

    Thanks.

    Removing the query_posts() caused no posts to be displayed but simply adding '' made it work, e.g. query_posts('').

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.