ID, 'large' ); if ( $thumb ) { $content = '

' . $content; } return $content; } /** * カテゴリーリストのカスタマイズ */ add_action( 'wp_list_categories', __NAMESPACE__ . '\hook_wp_list_categories', 10, 2 ); function hook_wp_list_categories( $output, $args ) { // walker指定された特殊なリストには何もしない // if ( isset( $args['walker'] ) ) return $output; if ( apply_filters( 'arkhe_move_post_count_into_a', true, 'wp_list_categories' ) ) { // 投稿数をの中に移動 $output = preg_replace( '/<\/a>\s*\((\d+)\)/', ' ($1)', $output ); } if ( ! $args['hierarchical'] ) return $output; // memo: ul を含む li // $regex = '/]*>(?:(?!<\/li>).)*