WordPress.org

Support

Support » How-To and Troubleshooting » Static front page pagination documentation amy be wrong?

Static front page pagination documentation amy be wrong?

  • chrishoward
    Participant

    @chrishoward

    Reading the Pagination page in the Codex, I couldn’t get the instructions for making pagination work on a static home page until I added:
    global $paged;

    before everything. I couldn’t see any mention of this requirement on that page (assuming it is a requirement).

Viewing 2 replies - 1 through 2 (of 2 total)
  • kjodle
    Participant

    @kjodle

    I couldn’t get the instructions for making pagination work on a static home page

    A static home page is, by definition, a single page and doesn’t require pagination. It is “page 1 of 1 pages”.

    So where are you trying to get pagination to appear?

    chrishoward
    Participant

    @chrishoward

    On “static front page.

    All pages are static “page 1 of 1 pages” but pagination works on them. It’s only the “static front page” where you need special code to make pagination work.

    Sometimes, some people do want a front page that is a blend of static content and paged posts.

    To that end, that instruction page on Pagination tells you how it *should* work. To quote the whole section:

    static front page

    If the pagination is broken on a static front page you have to add the “paged” parameter this way:

    <?php
    if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
    elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
    else { $paged = 1; }
    
    query_posts('posts_per_page=3&paged=' . $paged);
    ?>

    But without the global $paged; it doesn’t work for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Static front page pagination documentation amy be wrong?’ is closed to new replies.