Блог

WordPress вывод slug всех рубрик привязанных к посту

<?php
                                $categories = get_the_category();
                                $cls = '';

                                if ( ! empty( $categories ) ) {
                                    foreach ( $categories as $cat ) {
                                    $cls .= $cat->slug . ' ';
                                    }
                                }

                                echo $cls;
                                ?>

 

0 0 vote
Article Rating
guest
0 Комментарий
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x