Skip to content

Commit

Permalink
Added a proper thousands delimiter function for category post counts
Browse files Browse the repository at this point in the history
Minor code formatting tweaks
  • Loading branch information
splorp committed Jun 3, 2010
1 parent 2b6bdfa commit 6e99fba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion functions.php
Expand Up @@ -28,6 +28,16 @@ function simple_post_class() {



// Add a proper thousands delimiter to category post counts

function delim($c) {
return preg_replace('/(\d)(\d{3})\b/','\1,\2',$c); // Hat tip to @myfonts for the regex tweaks
}

add_filter('wp_list_categories','delim');



// Remove extraneous class attributes from list elements

function declass($c) {
Expand All @@ -38,8 +48,9 @@ function declass($c) {
}

add_filter('wp_list_pages','declass');
add_filter('wp_list_categories','declass');
add_filter('wp_list_bookmarks','declass');
add_filter('wp_list_categories','declass');



// Add support for the_post_thumbnail
Expand Down

0 comments on commit 6e99fba

Please sign in to comment.