Más contenido relacionado
La actualidad más candente (20)
Similar a 静的HTMLファイルをWordPressのテーマにするワークショップ (20)
静的HTMLファイルをWordPressのテーマにするワークショップ
- 28. 投稿記事を表示
index.php
<?php if (have_posts() ): ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class=“blog-top”>
<h3><a href=“<?php the_permalink(); ?>”><?php the_title(); ?></a></h3>
<div class=“entry-meta”><?php the_time(Y年n月j日); ?></div>
<?php the_content(); ?>
<div class=“more-link”><a href=“<?php the_permalink();>”>続きを読む</a></div>
</article>
<?php endwhile; ?>
<?php endif; ?>
- 29. 投稿記事の抜粋を表示
index.php
<?php if (have_posts() ): ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class=“blog-top”>
<h3><a href=“<?php the_permalink(); ?>”><?php the_title(); ?></a></h3>
<?php if ( is_front_page() ) : ?>
<?php the_excerpt(); ?>
<div class=“more-link”><a href=“<?php the_permalink();>”>続きを読む</a></div>
<?php else : ?>
<?php the_content(); ?>
<?php endif; ?>
</article>
<?php endwhile; ?>
<?php endif; ?>