• it works everywhere, except category.php
    nothing turns me what to do
    ———————————-

    <?php endwhile; ?>
    <!–Post navigations–>
    <?php
    global $wp_query;
    $big = 999999999; // need an unlikely integer
    echo 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
    ) );
    ?>
    <?php else: ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hmm. I’m not sure exactly how to fix this, but you could look at the code in the WP-PageNavi plugin for how they do category page navigation/pagination.

    https://wordpress.org/plugins/wp-pagenavi/

    this is working on my local try it out

    global $wp_query;
    
    	$big = 999999999; // need an unlikely integer
    
    	$links = 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_text' => '<i class="fa fa-left"></i>',
    		'next_text' => '<i class="fa fa-right"></i>'
    	) );
    ?>
    	<div>
    		<?php echo $links; ?>
    	</div>

    can you also use pastebin to paste your archive/ category page code may be some loop issue in there

    Thread Starter alex1nd

    (@alex1nd)

    it only helps

    functions

    function remove_page_from_query_string($query_string)
    {
    if ($query_string[‘name’] == ‘page’ && isset($query_string[‘page’])) {
    unset($query_string[‘name’]);
    list($delim, $page_index) = split(‘/’, $query_string[‘page’]);
    $query_string[‘paged’] = $page_index;
    }
    return $query_string;
    }
    add_filter(‘request’, ‘remove_page_from_query_string’);
    function fix_category_pagination($qs){
    if(isset($qs[‘category_name’]) && isset($qs[‘paged’])){
    $qs[‘post_type’] = get_post_types($args = array(
    ‘public’ => true,
    ‘_builtin’ => false
    ));
    array_push($qs[‘post_type’],’post’);
    }
    return $qs;
    }
    add_filter(‘request’, ‘fix_category_pagination’);

    Thread Starter alex1nd

    (@alex1nd)

    This problem Permalink

    Moderator bcworkz

    (@bcworkz)

    This problem Permalink

    I’m not clear on what your problem is. Please state what problem you are now having in light of your recent code and what should be happening instead.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘paginate_links in category.php NOT WORK’ is closed to new replies.