WordPress.org

Support

Support » How-To and Troubleshooting » query_posts pagination with offset problem

query_posts pagination with offset problem

  • I’m trying to use query_posts om my front page to skip the most recent post (which appears in a feature box) but also include pagination.

    This is the original code, which breaks pagination:

    <?php
    $limit = 4;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=' . $limit . '&paged=' . $paged .'&offset=1&cat=');
    $wp_query->is_archive = true; $wp_query->is_home = false;
    ?>

    I’ve replaced that with this (found at http://wordpress.org/support/topic/57912?replies=9) which fixes the pagination issue.

    <?php
    if (is_home()) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("paged=$paged");
    }
    ?>

    But now I’d like to add back in the offset=1 parameter

    <?php
    if (is_home()) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("offset=1&paged=$paged");
    }
    ?>

    and pagination breaks again. Is there another way to add in the offset?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts pagination with offset problem’ is closed to new replies.