Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save faisalahammad/2b18880d0f5dea86dcadcd25f6217b63 to your computer and use it in GitHub Desktop.
Save faisalahammad/2b18880d0f5dea86dcadcd25f6217b63 to your computer and use it in GitHub Desktop.
A simple way to remove the default thousand separator from WordPress pagination. If you’re tired of seeing those pesky commas in your page numbers, this quick snippet will clean them up for you. Just drop it into your theme’s functions.php and enjoy cleaner pagination links!
<?php
/**
* Remove thousand separator from WordPress pagination
* @author Faisal Ahammad
*/
/**
* @param $output
* @return mixed
*/
function remove_thousand_separator_pagination( $output )
{
$output = str_replace( ',', '', $output );
return $output;
}
add_filter( 'paginate_links', 'remove_thousand_separator_pagination' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment