Created
September 4, 2024 18:24
-
-
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!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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