採用サイト制作に最適なWordPressテーマ「ISSUE」の機能概要

ワードプレステーマ別

TCDテーマSWEETY:トップページのBLOG欄に「カテゴリー」を表示させる方法

Q.トップページのBLOG欄にアイキャッチ画像とタイトルの他に「カテゴリー」も表示させたい。

A.下記のファイルを編集します

編集するファイル:index.php
編集する箇所:

<div class="right">
   <h3 class="headline"><?php echo $options['index_blog_headline']; ?></h3>
   <ol>
    <?php
         foreach ($index_blog_list as $post) : setup_postdata ($post);
    ?>
    <li class="clearfix">
     <a class="image" href="<?php the_permalink() ?>"><?php the_post_thumbnail('size1'); ?></a>
     <?php if ($options['show_date']){ ?><p class="date"><time class="entry-date updated" datetime="<?php the_modified_time('c'); ?>"><?php the_time('Y.n.j'); ?></time></p><?php }; ?>
     <a class="title" href="<?php the_permalink() ?>"><?php the_title(); ?></a>

のすぐ下に、以下のコードを挿入頂きます。

<div class="category"><?php the_category(', ') ?></div>

この記事は役に立ちましたか?

もし参考になりましたら、下のボタンで教えてください。
今後の記事作成の参考とさせて頂きます!

同じテーマのカスタマイズ記事