Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 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' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement