Skip to content

Instantly share code, notes, and snippets.

@lauhakari
Last active December 28, 2021 01:07
Show Gist options
  • Save lauhakari/5089252 to your computer and use it in GitHub Desktop.
Save lauhakari/5089252 to your computer and use it in GitHub Desktop.
Change the pagination url in Wordpress (3+) You can put in a plugin file or your functions.php.
<?php
add_action( 'init', 'my_custom_page_word' );
function my_custom_page_word() {
global $wp_rewrite; // Get the global wordpress rewrite-rules/settings
// Change the base pagination property which sets the wordpress pagination slug.
$wp_rewrite->pagination_base = "new-slug"; //where new-slug is the slug you want to use ;)
}
@lauhakari
Copy link
Author

@saladgoat Yeah, not sure you can (easily) have different pagination_base's for different sections.
I believe that pagination_base is more used to change the base path on the whole site. :)

@saladgoat
Copy link

@lauhakari I was afraid of that, but trying to be optimistic, thought I'd ask people who know way more about this than me....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment