/*
* Add spans around category counters
*/
function _thz_filter_wp_list_categories($output, $args) {
if($args['show_count']){
$re = '/<\/a>(.*?)<\/li>/s';
preg_match_all($re, $output, $matches);
if(!empty($matches) && isset($matches[1])){
foreach($matches[1] as $between){
$between = strip_tags($between);
$output = str_replace($between,'<span class="count">'.$between.'</span>',$output);
}
}
}
return $output;
}
add_filter('wp_list_categories', '_thz_filter_wp_list_categories',10,2);
/*
* Add spans around archive counters
*/
function _thz_filter_get_archives_link($output) {
$re = '/<\/a>(.*?)<\/li>/s';
preg_match_all($re, $output, $matches);
if(!empty($matches) && isset($matches[1])){
foreach($matches[1] as $between){
$between = strip_tags($between);
$output = str_replace($between,'<span class="count">'.$between.'</span>',$output);
}
}
return $output;
};
add_filter('get_archives_link', '_thz_filter_get_archives_link', 10, 6);
당신이 순서대로 나는 효과를 설명한 달성하기 위해 그것을 사용하는 방법의 예를 제공하시기 바랍니다 수 있습니까? widget_categories_args에 대해 읽었지만 수정할 매개 변수를 아직 모릅니다. – vlad