wordpressについての記事だけのアーカイブにはサムネイル画像を表示させたくない

1. archive.phpをコピーして、category-wordpress_study.phpとリネイム

/**
* The template for displaying Archive pages.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package _s
*/

は削除する。

 

2. content.phpをコピーしてcontent-study.phpを作り、thumbnailのdivboxを削除。

<div class=”large-3 small-3 columns thumbnail”>
<a href=”<?php the_permalink(); ?>” title=”<?php echo esc_attr( sprintf( __( ‘Permalink to %s’, ‘_s’ ), the_title_attribute( ‘echo=0’ ) ) ); ?>” rel=”bookmark”>
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail( ‘top-thumb’ ); ?>
<?php else : ?>
<img src=”<?php echo get_template_directory_uri(); ?>/assets/img/no_image.gif” alt=”” title=”” />
<?php endif; ?>
</a>
</div> <!– thumbnail –>

3. category-wordpress_study.phpの

get_template_part( ‘content’, get_post_format() をget_template_part( ‘content-study’, get_post_format()

と変更。これで、thumbnailの入らないwordpress_studyのアーカイブができる。