< ?php
foreach((get_the_category()) as $cat) {
echo ‘<img src=”wp-content/themes/mopix/images/’ . $cat->cat_ID . ‘.gif” alt=”‘ . $cat->cat_name . ‘” />;
}
?>
< ?php if (have_posts()) : ?>
< ?php while (have_posts()) : the_post(); ?>
〜〜
< ?php endwhile; ?>
< ?php endif; ?>
のループ内に記載。
カテゴリIDの数字の名前のついた画像を用意する
Tags: wordpress