WordPress.org

Ready to get started?Download WordPress

Forums

Pagination doesn't show on pages (2 posts)

  1. waseembari1985
    Member
    Posted 7 months ago #

    Hi everyone,

    I am using Bootstrap and WordPress. Below is the code for my one of the page, I don't know why it doesn't show the pagination. I think there is some problem with my Query but unable to find it out. Please have a look on below code and suggest me.

    <?php
    get_header();
    get_sidebar();
    ?>
    <section <?php post_class("col-md-9") ?> id="post-<?php the_ID(); ?> layout-thumbs">
    <h1><span><?php wp_title(''); ?></span></h1>

    <?php page_navi(); ?>
    </section>
    <?php get_footer(); ?>

  2. Mohsin Patel
    Member
    Posted 6 months ago #

    From code seems like your are using <?php page_navi(); ?> for displaying paging.

    Please make sure that this function is available in functions.php OR related plugin for supporting that function is active.

    Another Alternative Way :
    -------------------------

    Simply replace <?php page_navi(); ?>

    with below code

    <?php
    global $wp_query;
    $big = 999999999; // need an unlikely integer
    echo paginate_links( array(
    'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
    'format' => '?paged=%#%',
    'current' => max(2, get_query_var('paged') ),
    'total' => $wp_query->max_num_pages,
    'show_all' => false,
    'prev_next' => True,
    'prev_text' => __('« Previous'),
    'next_text' => __('Next »')
    ) );?>

    For more details you can refer the below tutorials which explain much deeper level of replacement of the code

    http://www.shoutgeek.com/how-to-add-numeric-pagination-wordpress-theme/

    Let me know if any difficulties further to make it work.

Reply

You must log in to post.

About this Topic