Wordpress:Space 在 slug 之间
Wordpress: Space between the slugs
我有这个代码来显示 post 的 slug:
<?php $terms = get_the_terms( $post->ID, 'project-category' ); foreach($terms as $term){ echo $term->slug; } ?>
但现在他们像这样互相粘着:
cateogry-01cateogry-02
我怎样才能让它像:
cateogry-01 cateogry-02
变化:
echo $term->slug;
至:
echo $term->slug . ' ';
我有这个代码来显示 post 的 slug:
<?php $terms = get_the_terms( $post->ID, 'project-category' ); foreach($terms as $term){ echo $term->slug; } ?>
但现在他们像这样互相粘着:
cateogry-01cateogry-02
我怎样才能让它像:
cateogry-01 cateogry-02
变化:
echo $term->slug;
至:
echo $term->slug . ' ';