admin管理员组

文章数量:1122832

Can this function...

function custom_pagination_base() {
global $wp_rewrite;
$wp_rewrite->pagination_base = 'p';
$wp_rewrite->flush_rules();
}
add_action( 'init', 'custom_pagination_base' );

...be somehow used to change the from of the url from "page/2/" not to "p/2/" but to "?p=2"?

Can this function...

function custom_pagination_base() {
global $wp_rewrite;
$wp_rewrite->pagination_base = 'p';
$wp_rewrite->flush_rules();
}
add_action( 'init', 'custom_pagination_base' );

...be somehow used to change the from of the url from "page/2/" not to "p/2/" but to "?p=2"?

Share Improve this question edited Jul 12, 2016 at 6:21 Pieter Goosen 55.4k23 gold badges115 silver badges209 bronze badges asked Apr 25, 2013 at 12:44 user23068user23068
Add a comment  | 

1 Answer 1

Reset to default 0

I am not entirely sure what you are asking but that ?p= pattern is a raw query string. That is, that is what you get without pretty permalinks at all.

Go to Settings->Permalinks in wp-admin and select the default permalinks. Save and you are done. You don't need any other function. If that doesn't solve it you need to rewrite your question so that it is more clear.

本文标签: permalinksHow to change pagination base from slash to query form