Site logo

Archived topic

changing the categories style

18 replies · Started by Halil on February 11, 2018

Viewing posts 16–19 of 19

This is the best way to removes commas:

add_filter( 'generate_category_list_output', 'tu_remove_category_commas' );
function tu_remove_category_commas() {
	$categories_list = get_the_category_list( ' ' );
	return sprintf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', // WPCS: XSS ok, sanitization ok.
		esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
		$categories_list
	);
}

awesome. thanks.

You're welcome :)

This archived topic is closed to new replies.