Support » Plugin: WP-Paginate » Category Pagination Not Working

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jennifer Moss

    (@mossifer)

    I suspect because our permalink structure is:

    /%category%/%postname%/

    so it’s seeing /category/2 as a post not found.

    Thread Starter Jennifer Moss

    (@mossifer)

    Never mind – I found code that fixed it. If anyone is interested:

    /*** CATEGORY PAGINATION FIX ***/
    function remove_page_from_query_string($query_string)
    {
    if ($query_string[‘name’] == ‘page’ && isset($query_string[‘page’])) {
    unset($query_string[‘name’]);
    // JAM HACK
    $query_string[‘paged’] = $query_string[‘page’];
    }
    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’);

    Plugin Author AlanP57

    (@alanp57)

    Thank you Jennifer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category Pagination Not Working’ is closed to new replies.