How to Fix Pagination and Navigation Issues in Twenty Sixteen
Content
Many users of the Twenty Sixteen theme encounter issues with pagination and post navigation. These problems can range from pagination links appearing when they shouldn't, to navigation not displaying at all on custom templates. This guide will explain the common causes and provide solutions to get your site's navigation working correctly.
Common Pagination and Navigation Issues
Based on community reports, the most frequent issues include:
- Pagination displaying when there are fewer posts than the 'Posts per page' setting
- Custom templates not showing page navigation links
- Navigation appearing only at the bottom of pages when users want it at both top and bottom
- Author pages showing blank screens instead of post listings
Why These Issues Occur
Most pagination problems in Twenty Sixteen stem from one of these causes:
- Custom code conflicts: Custom templates or functions.php modifications may not properly handle the WordPress query variables that control pagination.
- Child theme issues: CSS in child themes can sometimes accidentally hide navigation elements.
- Plugin conflicts: Some plugins can interfere with how WordPress handles queries and pagination.
- Incorrect template usage: Using the wrong template file or modifying core files without proper understanding can break navigation features.
Solutions and Fixes
1. Fixing Always-Visible Pagination
If your pagination shows even when there aren't enough posts to warrant it, check your custom pagination function. The issue is often in how you're checking the total number of pages:
function wp_numeric_pagination() {
global $wp_query;
// Only show pagination if we have more than one page
if ($wp_query->max_num_pages <= 1) {
return;
}
$big = 999999999;
$tag = '' . PHP_EOL;
$tag .= paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => True,
'prev_text' => __(' __('>'),
) ) . PHP_EOL;
$tag .= '' . PHP_EOL;
echo $tag;
}
The key addition is the conditional check if ($wp_query->max_num_pages <= 1) which prevents the pagination from displaying when there's only one page of results.
2. Adding Navigation to Custom Templates
If you've created a custom template based on archive.php and lost pagination, ensure you're using the correct function for your navigation. For custom post type archives, you might need to use:
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '',
) );
3. Blank Author Pages
If author pages (domain.com/author/name) show blank white screens, check your child theme's CSS for rules that might be hiding author content. One user found this problematic CSS in their child theme:
.author {
display: none;
}
Remove or modify such rules to restore author page functionality.
4. Plugin Conflict Testing
If you're experiencing unexpected behavior with pagination or navigation, temporarily disable all plugins to see if the issue resolves itself. If it does, reactivate plugins one by one to identify the culprit. Many navigation issues, including blank author pages, can be caused by plugin conflicts.
5. Adding Top and Bottom Navigation
To display navigation at both the top and bottom of post listings, you'll need to modify your template files (index.php, archive.php, search.php) in a child theme. Add the pagination function in both locations within the loop.
Prevention Tips
- Always use a child theme when modifying Twenty Sixteen
- Test pagination after making any template changes
- Keep plugins updated to minimize conflicts
- Use WordPress's built-in pagination functions rather than custom solutions when possible
By understanding how Twenty Sixteen handles pagination and following these solutions, you can resolve most navigation issues and ensure your visitors can easily browse your content.
Related Support Threads Support
-
how to disable previous and next post links in twenty sixteenhttps://wordpress.org/support/topic/how-to-disable-previous-and-next-post-links-in-twenty-sixteen/
-
Category page showing preview of blog postshttps://wordpress.org/support/topic/category-page-showing-preview-of-blog-posts/
-
Read More not workinghttps://wordpress.org/support/topic/read-more-not-working-27/
-
“Edit” link doesn’t work as it shouldhttps://wordpress.org/support/topic/edit-link-doesnt-work-as-it-should/
-
want to show summary of posthttps://wordpress.org/support/topic/want-to-show-summary-of-post/
-
Blog Feed Incorrecthttps://wordpress.org/support/topic/blog-feed-incorrect/
-
“Fake” a title for untitled postshttps://wordpress.org/support/topic/fake-a-title-for-untitled-posts/
-
Filter Hook for “twentysixteen_post_thumbnail()”https://wordpress.org/support/topic/filter-hook-for-twentysixteen_post_thumbnail/
-
"Previous page" and "Next page" is not displayed wellhttps://wordpress.org/support/topic/previous-page-and-next-page-is-not-displayed-well/
-
Sidebar issueshttps://wordpress.org/support/topic/sidebar-issues-40/
-
How to make titles not hyphenatehttps://wordpress.org/support/topic/how-to-make-titles-not-hyphenate/
-
Post Titles not showing on blog pagehttps://wordpress.org/support/topic/post-titles-not-showing-on-blog-page/
-
Change full posts for summaryhttps://wordpress.org/support/topic/change-full-posts-for-summary/
-
Change post thumbnail linkhttps://wordpress.org/support/topic/change-post-thumbnail-link/
-
Footer at main page (last posts)https://wordpress.org/support/topic/footer-at-main-page-last-posts/
-
Posts Page Not Loading Correctlyhttps://wordpress.org/support/topic/posts-page-not-loading-correctly/
-
[NSFW] How to Bring Original Pagination Back Following Child Theme Tweakshttps://wordpress.org/support/topic/how-to-bring-original-pagination-back-following-child-theme-tweaks/
-
next/previous page links positionhttps://wordpress.org/support/topic/next-previous-page-links-position/
-
Keep Next and Previous post in categoryhttps://wordpress.org/support/topic/keep-next-and-previous-post-in-category/
-
Grid layout Postshttps://wordpress.org/support/topic/grid-layout-posts/
-
How to Switch from Full Posts to Summarieshttps://wordpress.org/support/topic/how-to-switch-from-full-posts-to-summaries/
-
Pagination (using nextpage tag) location too removed from main contenthttps://wordpress.org/support/topic/pagination-using-nextpage-tag-location-too-removed-from-main-content/
-
Use same horizontal rule from posts page on custom pageshttps://wordpress.org/support/topic/use-same-horizontal-rule-from-posts-page-on-custom-pages/
-
Author page bio?https://wordpress.org/support/topic/author-page-bio/
-
Theme showing Full Post not Summaryhttps://wordpress.org/support/topic/theme-showing-full-post-not-summary/
-
Content Summary Displayhttps://wordpress.org/support/topic/content-summary-display/
-
Avatars next to posts on Home Pagehttps://wordpress.org/support/topic/avatars-next-to-posts-on-home-page/
-
Unwanted Duplicate Postshttps://wordpress.org/support/topic/unwanted-duplicate-posts/
-
Customized template don’t show page navigationhttps://wordpress.org/support/topic/customized-template-dont-show-page-navigation/
-
Weird bbPress Subscribe Toggle Placementhttps://wordpress.org/support/topic/weird-bbpress-subscribe-toggle-placement/
-
Post Summary Setting not Workinghttps://wordpress.org/support/topic/post-summary-setting-not-working/
-
remove archive links from single post viewhttps://wordpress.org/support/topic/remove-archive-links-from-single-post-view/
-
No author page?https://wordpress.org/support/topic/no-author-page/
-
Turning off author photohttps://wordpress.org/support/topic/turning-off-author-photo/
-
I want to change the place where related posts are shownhttps://wordpress.org/support/topic/i-want-to-change-the-place-where-related-posts-are-shown-2/
-
Fixing titleshttps://wordpress.org/support/topic/fixing-titles/
-
custom archive viewhttps://wordpress.org/support/topic/custom-archive-view/
-
Problem with pagination with posts pagehttps://wordpress.org/support/topic/problem-with-pagination-with-posts-page/
-
twenty-sixteen "Posts page"https://wordpress.org/support/topic/twenty-sixteen-posts-page/
-
Jetpack sharing buttons appear under excerptshttps://wordpress.org/support/topic/jetpack-sharing-buttons-appear-under-excerpts/
-
[Theme: Twenty Sixteen] Post format navigationhttps://wordpress.org/support/topic/theme-twenty-sixteen-post-format-navigation/
-
Add title – errorhttps://wordpress.org/support/topic/add-title-error/
-
reverse post navigation at bottom of page.https://wordpress.org/support/topic/reverse-post-navigation-at-bottom-of-page/
-
Automatic post excerpts in WordPress themehttps://wordpress.org/support/topic/automatic-post-excerpts-in-wordpress-theme/
-
Tag Problemhttps://wordpress.org/support/topic/tag-problem-7/
-
Pagination Issueshttps://wordpress.org/support/topic/pagination-issues-9/
-
Display only Post Title on archiveshttps://wordpress.org/support/topic/display-only-post-title-on-archives/
-
[archives] shortcodehttps://wordpress.org/support/topic/archives-shortcode-2/
-
Unwanted Duplicate Excerpthttps://wordpress.org/support/topic/unwanted-duplicate-excerpt/
-
Blog Pagehttps://wordpress.org/support/topic/bog-page/
-
Page names appearing multiple timeshttps://wordpress.org/support/topic/page-names-appearing-multiple-times/