Support » Plugin: WP-PageNavi » add_rewrite_rule disabled Pagenavi…

  • Hi, Pagenavi users.
    Without add_rewrite_rule this URL works e.g. http://www.mysite.com/acer/aspire_e/

    <?php
    function add_query_vars($new_var) {
    $new_var[] = "ps";
    $new_var[] = "page";
    return $new_var;
    }
    add_filter('query_vars', 'add_query_vars');
    
    function add_rewrite_rules($myrules) {
    $newrules = array(
    '^acer/(aspire_e|aspire_p|aspire_m)/?$' => 'index.php?page_id=997&ps=$matches[1]', 'top',    '^acer/(aspire_e|aspire_p|aspire_m)(/page/?([0-9]{1,}))/?$' => 'index.php?page_id=997&ps=$matches[1]&page=$matches[2]', 'top'
    );
    $myrules = $newrules + $myrules;
    return $myrules;
    }
    add_filter('rewrite_rules_array', 'add_rewrite_rules');
    ?>

    but when I apply add_rewrite_rule pagination doesn’t work anymore. Though the add_rewrite_rule gives the URL
    http://www.mysite.com/acer/aspire_e/page/2/ for example.
    Have anyone here encountered this error? any help would be appreciated. 🙂

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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_rewrite_rule disabled Pagenavi…’ is closed to new replies.