wordpressのCustom Post Type UIというプラグインを利用し
カスタム投稿タイプを追加しました。
その投稿のスラッグのsingleページを作ったのですが
1つの記事だけでなくアーカイブのように
同じカスタム投稿の他の記事も出力してしまいます。
コード貼りますので、原因を教えていただければ幸いです。
UTF
1<?php get_header(2); ?> 2<section id="post_area" class="container"> 3<?php query_posts('post_type=home&paged='.$paged); ?> 4 <?php if ( have_posts() ) : ?> 5 <?php while ( have_posts() ) : the_post(); ?> 6 <div class="custom_img"> 7<?php 8$img = get_field('img'); 9$imgurl = wp_get_attachment_image_src($img, 'full'); 10if($imgurl){ ?><img src="<? echo $imgurl[0]; ?>" alt=""> 11<? } ?></div> 12<div class="custom_area"> 13 <div class="table_titlearea"> 14 <h3 class="table_title1"><?php the_field('choice'); ?></h3> 15 <h2 class="table_title2"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> 16 </div> 17<div class="pd_area"></div> 18<table class="custom_table"> 19 <tbody> 20 <tr> 21 <th scope="row">所在地</th> 22 <td><?php the_field('place'); ?></td> 23 <th scope="row">費用</th> 24 <td><?php the_field('plice'); ?></td> 25 </tr> 26 <tr> 27 <th scope="row">間取り</th> 28 <td><?php the_field('floor'); ?></td> 29 <th scope="row">築年数</th> 30 <td><?php the_field('age'); ?></td> 31 </tr> 32 <tr> 33 <th scope="row">敷地面積</th> 34 <td><?php the_field('area'); ?></td> 35 <th scope="row">床面積</th> 36 <td><?php the_field('space'); ?></td> 37 </tr> 38 <tr> 39 <th scope="row">補修の要否</th> 40 <td><?php the_field('repair'); ?></td> 41 <th scope="row">設備状況</th> 42 <td><?php the_field('facility'); ?></td> 43 </tr> 44 <tr> 45 <th scope="row">利用状況</th> 46 <td><?php the_field('use'); ?></td> 47 <th scope="row">その他</th> 48 <td><?php the_field('other'); ?></td> 49 </tr> 50 </tbody> 51</table> 52<div class="coment_area"> 53<h3>コメント</h3> 54 <?php the_content(); ?> 55</div> 56 <?php endwhile; ?> 57 <?php endif; ?> 58</div> 59</section> 60<div class="clear"></div> 61</div> 62<?php get_footer(); ?>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/29 12:51
退会済みユーザー
2017/03/29 13:18
2017/03/29 13:22