Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_wpc_item_categories( $category, $params ) {
- if ( $params['params']['show_category'] === 'true' ) {
- $categories_list = get_the_terms($params['post']->ID, $params['post_type_category']);
- $count_$categories_list = count($categories_list);
- if ( $categories_list ) {
- $category = '<p class="wp-posts-carousel-categories">';
- foreach ( $categories_list as $cat ) {
- /*
- * your condition to display only selected categories
- */
- if ( $categories_list > 1 && $cat->term_id != 8) {
- $category .= '<a href="' . get_category_link($cat->term_id) . '" title="' . esc_attr(sprintf(__("View all items in %s") , $cat->name)) . '">' . $cat->name . '</a> ';
- }
- }
- $category .= '</p>';
- }
- }
- return $category;
- }
- add_filter('wpc_item_categories', 'custom_wpc_item_categories', 1, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement