Support » Fixing WordPress » Pagination not working

  • juliabfragoso

    (@juliabfragoso)


    Hey guys!

    Old trouble with pagination. My theme has a custom function.php and I don’t have enough php knowledge to pinpoint where the error might be.

    But the pagination on our journal page is not working, meaning that the page 1 and 2 are the same. It does help to change theme. It does not help to flush permalinks, which makes me think it’s the loop. Here’s the code:

    Functions.php:

    if ( ! function_exists( ‘lobo_pagination’ ) ) {

    function lobo_pagination( $query = null ) {

    if ( $query == null ) {
    global $wp_query;
    $query = $wp_query;
    }

    $page = $query->query_vars[‘paged’];
    $pages = $query->max_num_pages;

    if ( $page == 0 ) {
    $page = 1;
    }

    $html = ”;

    if( $pages > 1 ) {

    $html .= ‘<div class=”pagination clearfix face-control”>’;

    if ( $page + 1 <= $pages ) {
    $html .= ‘<div class=”prev-post”>‘ . ‘<div class=”pagination-inner”>’ . __( ‘Older Posts’ ,’lobo’ ) . ‘</div></div>’;
    }

    if ( $page – 1 >= 1 ) {
    $html .= ‘<div class=”next-post”><div class=”pagination-inner”>’ . __( ‘Newer Posts’ ,’lobo’ ) . ‘</div></div>’;
    }

    $html .= ‘</div>’;

    }

    echo $html;

    }

    }

    if ( ! function_exists( ‘lobo_infinite_pagination’ ) ) {

    function lobo_infinite_pagination( $query = null ) {

    if ( $query == null ) {
    global $wp_query;
    $query = $wp_query;
    }

    $page = $query->query_vars[‘paged’];
    $pages = $query->max_num_pages;

    if ( $page == 0 ) {
    $page = 1;
    }

    echo get_pagenum_link( $page + 1 );

    }

    }

    Thank you for any insights. I don’t have theme support anymore.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Rajan V

    (@rajanit2000)

    @juliabfragoso

    Do you have using any other pagination plugin? if yes please disable it
    And May I know your post count?

    And make comment your code in functions.php and runt the following URL if it’s working please let us know here

    Domain/?page=1
    Domain/?page=2

    juliabfragoso

    (@juliabfragoso)

    I don’t use any plugin for that.

    I have 18 published posts. Can you be more specific what to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagination not working’ is closed to new replies.