$font, 'font-weight' => $font_weight, 'text-transform' => $text_transform, 'font-style' => $font_style, 'font-size' => $font_size, 'line-height' => $line_height, ) ); } // Link if ( $link === 'post' ) { $link_atts = ' href="' . apply_filters( 'the_permalink', get_permalink() ) . '"'; } elseif ( $link === 'custom' ) { $link_atts = us_generate_link_atts( $custom_link ); } else { $link_atts = ''; } $text_before = ( trim( $text_before ) != '' ) ? '' . trim( $text_before ) . ' ' : ''; // Set Button Style class $btn_classes = ''; if ( $style == 'badge' ) { $btn_classes = ' class="w-btn us-btn-style_' . $btn_style . '"'; } // Output the element $output = '
'; if ( ! empty( $icon ) ) { $output .= us_prepare_icon_tag( $icon ); } $output .= $text_before; if ( $style == 'badge' AND count( $terms ) > 1 ) { $output .= '
'; } $i = 1; foreach ( $terms as $term ) { if ( $link === 'archive' ) { $link_atts = ' href="' . get_term_link( $term ) . '"'; // Output "rel" attribute for Posts tags if ( $taxonomy_name == 'post_tag' ) { $link_atts .= ' rel="tag"'; } } if ( ! empty( $link_atts ) ) { $output .= '' . $term->name . ''; } else { $output .= '' . $term->name . ''; } // Output comma after anchor except the last one if ( $style != 'badge' AND $i != count( $terms ) ) { $output .= $separator; } $i++; } if ( $style == 'badge' AND count( $terms ) > 1 ) { $output .= '
'; } $output .= '
'; echo $output;