Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok, I worked out how to get my answer. In case anyone needs it: The global $query_string has the queries used for the loop by default. Links created with posts_nav_link() will add a paged parameter in the $query_string. So doing a query_posts() with the $query_string will do the trick correctly. However, if the loop is on a page, it will also have a pagename parameter that tells the loop to only render the page contents. We can override that parameter by setting it blank.

    So by doing a query_posts($query_string . '&pagename=&posts_per_page=4') we can recreate a list of posts like on the default front page. Check the extra options for query_posts for more options.

    I love this solution as it gives a lot of flexibility, but I still feel there’s probably a more elegant way of doing it.

    That works, but can someone please explain what a raw query_posts() looks like to just get the basic list-of-posts loop? Calling it with just posts_per_page achieves the basic effect, but posts_nav_link() doesn’t work.

Viewing 2 replies - 1 through 2 (of 2 total)