Rewrite (translate) the page portion of a URL in Wordpress

I would like to translate the unloaded portion of the URL, for example: currently: mysite.com/page/2 I would like to: mysite.com/p/2

Does anyone know a filter for this? Or would a custom rewrite be more appropriate? If so, how?

Thanks, Best regards.

+3
source share
1 answer

OK add this code below to your theme theme.php file

and reset you always specify

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

Thanks Manzurul

+1
source

Source: https://habr.com/ru/post/1789339/


All Articles