daily pastebin goal
95%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //カテゴリスラッグをクラス名に出力(複数可)
  3. $str = '';
  4. foreach((get_the_category()) as $cat){
  5.     $str .= $cat->category_nicename . ' ';
  6. }
  7. ?>
  8.  
  9. <li class="<?php echo rtrim($str, " "); ?>"><a href="<?php the_permalink(); ?>">
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top