ホームページのすべての投稿にワードプレスのアイキャッチ画像のサムネイルを追加するようにワードプレスを設定しました。
最初の投稿 [the_content() ~ 以下のコード] への wordpress の注目の画像のサムネイルの追加をスキップし、他の投稿 [the_excerpt() ~ 以下のコードの] のwordpress の注目の画像のサムネイルにのみ追加するコードを作成するにはどうすればよいですか?
content.php に入れて、ワードプレスの注目の画像のサムネイルをホームページに配置するコード。リンクはこちら
<?php if ( is_search() | is_home() ) : // Edit this to show excerpts in other areas of the theme?>
<div class="entry-summary">
<!-- This adds the post thumbnail/featured image -->
<div class="excerpt-thumb"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?></a></div>
<?php if($wp_query->current_post == 0 && !is_paged()) { the_content(); } else { the_excerpt(); } ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>