wordpressのトップページで最新記事のみ大きく表示させたいと思っています。
以下のようにindex.phpに記述していますが、最新記事を大きく表示させるための記述はどこにどのようなものを追加すれば良いのでしょうか。
<?php if(have_posts()): while(have_posts()): the_post(); ?> <article <?php post_class( 'a' ); ?>> <a href="<?php the_permalink(); ?>"> <?php if( has_post_thumbnail() ): ?> <?php the_post_thumbnail('thumbnail'); ?> <?php else: ?> <img src="<?php echo get_template_directory_uri(); ?>/images/no-image.gif" alt="no-img"/> <?php endif; ?> <div class="text"> <h2><?php the_title(); ?></h2> <span class="b"> <time datetime="<?php echo get_the_date() ?>"> <?php echo get_post_time( get_option('date_format') ); ?> </time> </span> <?php if (!is_category()): ?> <?php if( has_category() ): ?> <span class="cat"> <?php $postcat=get_the_category(); echo $postcat[0]->name; ?> </span> <?php endif; ?> <?php endif; ?> </div> </a> </article> <?php endwhile; endif; ?>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/08/01 23:22
2018/08/01 23:27
2018/08/02 01:51
2018/08/02 01:55