Wordpress: Space between the slugs

449 Views Asked by At

I have this code to display the slugs of the post:

<?php $terms = get_the_terms( $post->ID, 'project-category' ); foreach($terms as $term){ echo $term->slug; } ?>

But now they are sticky to each other like:

cateogry-01cateogry-02

How can i make it like:

cateogry-01 cateogry-02

1

There are 1 best solutions below

1
On BEST ANSWER

Change:

echo $term->slug;

to:

echo $term->slug . ' ';