WordPress.org

Support

Support » Plugins and Hacks » [Resolved] What argument do I give query_posts() to return same posts as index page?

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

  • 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….”

Viewing 3 replies - 1 through 3 (of 3 total)
  • Any help with this error?

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

    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

    Thanks.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] What argument do I give query_posts() to return same posts as index page?’ is closed to new replies.