Making WordPress.org


Ignore:
Timestamp:
01/29/2018 07:05:22 PM (7 years ago)
Author:
obenland
Message:

Showcase: Use built-in page navigation.

Removes the need for a plugin to provide a paginated navigation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/index.php

    r6273 r6456  
    77            breadcrumb();
    88            $num_posts = 400;
    9             if ( $paged > 1 ) $offset = "&offset=" . ($paged - 1) * $num_posts;
     9            $offset    = $paged > 1 ? "&offset=" . ($paged - 1) * $num_posts : '';
    1010            query_posts("showposts=" . $num_posts . "&post_type=post&post_status=publish" . $offset);
    1111        ?>
     
    1818
    1919            <?php endwhile; // have_posts ?>
    20             <?php if ( 1 != $wp_query->max_num_pages || function_exists( 'wp_page_numbers' ) ) { wp_page_numbers(); } ?>
     20            <?php
     21                the_posts_pagination( [
     22                    'current'  => $paged ?: 1,
     23                    'mid_size' => 2,
     24                ] );
     25            ?>
    2126
    2227        <?php else : // have_posts ?>
Note: See TracChangeset for help on using the changeset viewer.