Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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.

share|improve this answer
    
Indeed, but I'd rather have in this form only for pagination, just like with the other exception - search. –  user23068 Apr 25 '13 at 20:52
    
You can pass $_GET strings to a WordPress page but what you are trying to do is pass or manipulate query strings/parameters that are built into the WordPress core. ?p= is the WordPress Core parameter for "post ID = N". I expect, it is going to be a long hard road to alter that. –  s_ha_dum Apr 25 '13 at 20:56
    
Not necessarily, it was just a bad example, any word will do, such as "page". I was just wondering if this function could be used, with some method to remove the slash (now the result is "?page=/2) –  user23068 Apr 25 '13 at 22:59
    
Ok. So... can you think through what you want and clarify the question very carefully? I'd rather not keep guessing. –  s_ha_dum Apr 25 '13 at 23:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.