トップページに記事一覧が並んでいます。
その記事の上に〈カテゴリ名〉を表示させたいです。
このようなイメージです。
ところが、ループの中に1つだけ表示させる方法がわかりません。
現状は次のように書かれています。
■index.php
php
1<div id="container" class="<?php echo verbosa_get_layout_class(); ?>"> 2 <?php verbosa_header_section() ?> 3 <main id="main" role="main" class="main"> 4 <?php cryout_before_content_hook(); ?> 5 6 <?php if ( have_posts() ) : ?> 7 8 <div id="content-masonry" class="content-masonry" <?php cryout_schema_microdata( 'blog' ); ?>> 9 <?php /* Start the Loop */ 10 while ( have_posts() ) : the_post(); 11 get_template_part( 'content/content', get_post_format() ); 12 endwhile; 13 ?> 14 </div> <!-- content-masonry --> 15 <?php verbosa_pagination(); ?> 16 17 <?php else : 18 get_template_part( 'content/content', 'notfound' ); 19 endif; ?> 20 21 <?php cryout_after_content_hook(); ?> 22 </main><!-- #main --> 23 24</div><!-- #container -->
■content.php
php
1<?php 2/** 3 * The default template for displaying content 4 * 5 * @package Verbosa 6 */ 7 8$verbosas = cryout_get_option( array('verbosa_excerptarchive', 'verbosa_excerptsticky', 'verbosa_excerpthome') ); 9 10?><?php cryout_before_article_hook(); ?> 11 12<article id="post-<?php the_ID(); ?>" <?php post_class(); cryout_schema_microdata('blogpost'); ?>> 13 <?php cryout_featured_hook(); ?> 14 15 <header class="entry-header"> 16 <?php cryout_post_title_hook(); ?> 17 <?php cryout_meta_format_hook(); ?> 18 <?php if ( is_sticky() ) { ?> <span class="entry-format"><i class="icon-sticky"></i></span> <?php } ?> 19 <?php the_title( sprintf( '<h2 class="entry-title"' . cryout_schema_microdata( 'entry-title', 0 ) . '> 20 <a href="%s" ' . cryout_schema_microdata( 'mainEntityOfPage', 0 ) . ' rel="bookmark">', 21 esc_url( get_permalink() ) ), 22 '</a></h2>' ); 23 ?> 24 25 <div class="entry-meta"> 26 <?php cryout_post_meta_hook(); ?> 27 </div><!-- .entry-meta --> 28 29 </header><!-- .entry-header --> 30 31 <?php cryout_before_inner_hook(); 32 $mode = 'excerpt'; // default 33 if ( $verbosas['verbosa_excerptarchive'] == "full" ) { $mode = 'content'; } 34 if ( is_sticky() && $verbosas['verbosa_excerptsticky'] == "full" ) { $mode = 'content'; } 35 if ( $verbosas['verbosa_excerpthome'] == "full" && ! is_archive() && ! is_search() ) { $mode = 'content'; } 36 if ( false != get_post_format() ) { $mode = 'content'; } 37 38 switch ( $mode ) { 39 case 'content': ?> 40 41 <div class="entry-content" <?php cryout_schema_microdata( 'entry-content' ); ?>> 42 <?php the_content(); ?> 43 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'verbosa' ), 'after' => '</div>' ) ); ?> 44 </div><!-- .entry-content --> 45 46 <?php break; 47 48 case 'excerpt': 49 default: ?> 50 51 <div class="entry-summary" <?php cryout_schema_microdata( 'entry-summary' ); ?>> 52 <?php the_excerpt(); ?> 53 </div><!-- .entry-summary --> 54 <footer class="post-continue-container"> 55 <?php cryout_post_excerpt_hook(); ?> 56 </footer> 57 58 <?php break; 59 }; ?> 60 61<?php cryout_after_inner_hook(); ?> 62</article><!-- #post-<?php the_ID(); ?> --> 63 64<?php cryout_after_article_hook(); ?> 65
このどこに何を書けば、上図のようなイメージにできるか、教えて頂けませんでしょうか?