WordPress.org

Ready to get started?Download WordPress

Forums

paginator (0.2.1) updated to paginate categories (4 posts)

  1. mammalius
    Member
    Posted 5 years ago #

    Using the Paginator plugin, v0.2.1, by dzhus

    I had a request to paginate category content and, unless I've missed something, it doesn't seem this plugin will do that out of the box. The suggestion that follows introduces one new line of code and modifies the string that's passed to Paginator when instantiated. All happening in paginator.php's wp_paginator() definition.

    just after $page is declared, set $cat

    $paged = intval(get_query_var('paged'));
    $cat = (intval(get_query_var('cat'))) ? ('cat='. intval(get_query_var('cat')) . '&') : '';

    then, instead of passing

    pag = new Paginator("paginator",' . $wp_query->max_num_pages . ',' . $pages_to_show . ',' . $paged . ',"' . get_option('siteurl'). '/?paged=");

    use this

    pag = new Paginator("paginator",' . $wp_query->max_num_pages . ',' . $pages_to_show . ',' . $paged . ',"' . get_option('siteurl') . '/?' . $cat . 'paged=");
  2. dzhus
    Member
    Posted 5 years ago #

    Hi. I appreciate your contribution. I took a look on the code you provided. I think, it is the way to deal with categories. I still need to provide the way to display paginator for search results, tagged posts, and archived posts. I will deal with that ASAP and will incorporate the results as part of the next release.

  3. dzhus
    Member
    Posted 5 years ago #

    Just wanted to give a quick update on the issue. The problem with search results, tagged posts, archived posts, and results for categories can be solved using modified version of get_pagenum_link(), but to address all of these at once it would be a good idea to modify the javascript code. I will do this ASAP and will release the modified version some time this week.

  4. dzhus
    Member
    Posted 5 years ago #

    Hello. I have released a new version of the plugin today. It should take care of the problem. Please let me know if there are any other concerns. Thank you again for your feedback

Topic Closed

This topic has been closed to new replies.

About this Topic