ワードプレスでhtmlの静的ページに投稿を表示させるため、ループやタグを設定しましたが
投稿した記事が表示されません。投稿を表示させるにはどうすれがよいですか?
ピンクの箇所にサムネイル画像、下部にタイトルを反映させたい。
<?php require('./wp/wp-load.php'); ?> <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> 〜中略〜 <div class="c2"> <div class="container"> <div class="c2-inner"> <p class="c2-title">テキストテキストテキスト<br> <span>投稿した記事</span></p> <p class="content pad-10">テキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト<br> テキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト<br> テキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</p> <div class="row c2-middle"> <?php if (have_posts()):?> <?php while (have_posts()): the_post();?> <div class="col-xs-6 col-sm-4 col-md-4 col-lg-3"><a href="<?php the_permalink(); ?>"> <figure> <?php if (has_post_thumbnail()) : ?> <?php the_post_thumbnail(array(100, 100)); ?> <?php else: ?> <img src="<?php echo get_template_directory_uri(); ?>/images/square-img.png" alt="" width="100%" height="auto"> <?php endif; ?></figure> <figcaption><?php the_title(); ?></figcaption> </a></div> <?php endwhile;?> <?php endif;?> <?php wp_reset_query();?> </div> <!-- / .row --> </div> <!-- / .c2-inner --> </div> <!-- / .container --> </div> <!-- / .c2 -->
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/21 03:47
2018/02/21 04:04
退会済みユーザー
2018/02/21 04:11 編集
2018/02/21 04:10