// add multiple badges for elementor posts
add_action( 'elementor/widget/posts/skins_init', function( $widget ) {
class issue6480_skin extends \ElementorPro\Modules\Posts\Skins\Skin_Cards {
protected function render_badge() {
$taxonomy = $this->get_instance_value( 'badge_taxonomy' );
if ( empty( $taxonomy ) ) {
return;
}
$terms = get_the_terms( get_the_ID(), $taxonomy );
if ( ! is_array( $terms ) ) {
return;
}
?><div class="elementor-post__badges"><?php
foreach( $terms as $term ) : ?>
<a class="elementor-post__badge-item" href="<?php echo get_term_link($term); ?>"><?php echo $term->name; ?></a>
<?php endforeach; ?>
</div>
<?php
}
public function get_id() {
return 'cards_multi_badge';
}
public function get_title() {
return __( 'Cards Multi Badge', 'elementor-pro' );
}
}
// register the skin to the posts widget
$widget->add_skin( new issue6480_skin( $widget ) );
} );