Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //カテゴリスラッグをクラス名に出力(複数可)
- $str = '';
- foreach((get_the_category()) as $cat){
- $str .= $cat->category_nicename . ' ';
- }
- ?>
- <li class="<?php echo rtrim($str, " "); ?>"><a href="<?php the_permalink(); ?>">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement