Rewrite pagination slug in Wordpress


/ Published in: PHP
Save to your folder(s)

Rewrite "page" to "p" so /page/10 becomes /p/10


Copy this code and paste it in your HTML
  1. function custom_pagination_base()
  2. {
  3. global $wp_rewrite;
  4.  
  5. $wp_rewrite->pagination_base = 'p';
  6.  
  7. $wp_rewrite->flush_rules();
  8. }
  9.  
  10. add_action('init', 'custom_pagination_base', 1);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.