wordpress カテゴリーの配列
7月 12th, 2011 Author :: / Categories :: WordPress / トラックバックURL / No Comments »
<?php $cat = get_the_category(); $catslug = $cat[0]->slug; $catslug2 = $cat[0]->cat_name; ?>
これで配列を求めて、
<?php echo $catslug5; ?>
で呼び出す。
これで、CSSのクラスとか、イメージのファイル名を決めておけば、各カテゴリー毎に呼び出すイメージを帰られる。
7月 12th, 2011 Author :: / Categories :: WordPress / トラックバックURL / No Comments »
コメントを残す