/** * Add post categories in class * * @param mixed $output return html. * @return $output */ function reign_post_categories_callback( $output ) { global $post; $post_id = $post->ID; $post_category = get_the_category( $post->ID ); $cat_name = ''; foreach ( $post_category as $post_key => $post_val ) { $cat_name .= $post_val->slug . ' '; } $output = str_replace( 'cat-links', 'cat-links ' . $cat_name, $output ); return $output; } add_filter( 'reign_post_categories', 'reign_post_categories_callback' );